Back to index

salome-gui  6.5.0
Functions
tester.cxx File Reference
#include "QtHelper.hxx"
#include "MyDataModel.hxx"

Go to the source code of this file.

Functions

void TEST_DataObject ()
void TEST_DataModel ()
int main (int argc, char *argv[])

Function Documentation

int main ( int  argc,
char *  argv[] 
)

Definition at line 75 of file tester.cxx.

{
  TEST_DataObject();
  //TEST_DataModel();
}

Here is the call graph for this function:

Definition at line 47 of file tester.cxx.

                      {
  MyDataModel * dataModel = new MyDataModel();

  int refIter = 53;
  string refNameId;

  DataObject * dataObject;
  for (int i=0; i<100; i++) {
    // We can either create the data object using its constructor or
    // using the factory of the model (the prefered way):
    // dataObject = new MyDataObject();
    dataObject = dataModel->newDataObject();
    dataObject->setLabel("myobject"+ToString(i));
    if ( i == refIter ) {
      refNameId = dataObject->getNameId();
    }
    dataModel->addDataObject(dataObject);
  }

  dataObject = dataModel->getDataObject(refNameId);
  QLOG("object nameId = " << dataObject->getNameId().c_str());
  QLOG("path     = " << dataObject->getPath().c_str());
  QLOG("pathname = " << dataObject->getPathName().c_str());
}

Here is the call graph for this function:

Definition at line 33 of file tester.cxx.

                       {
  // In this test, the object id should increase at each instance
  DataObject * dataObject;
  for (int i=0; i<100; i++) {
    dataObject = new MyDataObject();
    QLOG("object nameId = " << dataObject->getNameId().c_str());
  }
  QLOG("path     = " << dataObject->getPath().c_str());
  QLOG("pathname = " << dataObject->getPathName().c_str());

  QLOG("serialize= " << dataObject->toString().c_str());

}

Here is the caller graph for this function: