OpenASIP  2.0
Functions
BusDialog.cc File Reference
#include <wx/wx.h>
#include <wx/listctrl.h>
#include <wx/radiobox.h>
#include <wx/spinctrl.h>
#include <boost/format.hpp>
#include "BusDialog.hh"
#include "Bus.hh"
#include "Segment.hh"
#include "Guard.hh"
#include "Conversion.hh"
#include "WxConversion.hh"
#include "WarningDialog.hh"
#include "ErrorDialog.hh"
#include "InformationDialog.hh"
#include "Machine.hh"
#include "MachineTester.hh"
#include "UserManualCmd.hh"
#include "ProDeConstants.hh"
#include "FUPort.hh"
#include "RFGuardDialog.hh"
#include "FUGuardDialog.hh"
#include "ModelConstants.hh"
#include "WidgetTools.hh"
#include "GUITextGenerator.hh"
#include "ProDeTextGenerator.hh"
Include dependency graph for BusDialog.cc:

Go to the source code of this file.

Functions

int wxCALLBACK ListCompareFunction (long item1, long item2, long WXUNUSED(sortData))
 

Detailed Description

Definition of BusDialog class.

Author
Veli-Pekka Jääskeläinen 2004 (vjaaskel-no.spam-cs.tut.fi)
Note
rating: red

Definition in file BusDialog.cc.

Function Documentation

◆ ListCompareFunction()

int wxCALLBACK ListCompareFunction ( long  item1,
long  item2,
long   WXUNUSEDsortData 
)

Defines how SortItems() does comparison between two items to sort the list.

Order: names in ascending order. Within same name, index numbers in ascending order. Within same name and index number, non-inverted guard comes before inverted.

Definition at line 375 of file BusDialog.cc.

376 {
377  // items are set with SetItemData to contain pointers to the rf guards
378  RegisterGuard* rfGuard1 = (RegisterGuard*) item1;
379  RegisterGuard* rfGuard2 = (RegisterGuard*) item2;
380  assert (rfGuard1 != NULL);
381  assert (rfGuard2 != NULL);
382 
383  string name1 = rfGuard1->registerFile()->name();
384  int index1 = rfGuard1->registerIndex();
385  bool inverted1 = rfGuard1->isInverted();
386 
387  string name2 = rfGuard2->registerFile()->name();
388  int index2 = rfGuard2->registerIndex();
389  bool inverted2 = rfGuard2->isInverted();
390 
391  if (name1 < name2) {
392  return -1;
393  } else if (name1 > name2) {
394  return 1;
395  } else if (index1 < index2) {
396  return -1;
397  } else if (index1 > index2) {
398  return 1;
399  } else if (!inverted1 && inverted2) {
400  return -1;
401  } else if (inverted1 && !inverted2) {
402  return 1;
403  }
404 
405  return 0;
406 }

References assert, TTAMachine::Guard::isInverted(), TTAMachine::Component::name(), TTAMachine::RegisterGuard::registerFile(), and TTAMachine::RegisterGuard::registerIndex().

Referenced by BusDialog::updateGuardLists().

Here is the call graph for this function:
TTAMachine::Component::name
virtual TCEString name() const
Definition: MachinePart.cc:125
TTAMachine::RegisterGuard::registerIndex
int registerIndex() const
assert
#define assert(condition)
Definition: Application.hh:86
TTAMachine::RegisterGuard
Definition: Guard.hh:137
TTAMachine::Guard::isInverted
virtual bool isInverted() const
TTAMachine::RegisterGuard::registerFile
const RegisterFile * registerFile() const