cgma
CastTo.hpp File Reference

Go to the source code of this file.

Defines

#define CAST_TO(classOnePtr, classTwo)   dynamic_cast<classTwo*>(classOnePtr)
#define STATIC_CAST_TO(classOnePtr, classTwo)   static_cast<classTwo*>(classOnePtr)
#define CAST_LIST_TO_PARENT(classOneList, classTwoList)
#define CAST_LIST(classOneList, classTwoList, classTwo)
#define STATIC_CAST_LIST(classOneList, classTwoList, classTwo)
#define CAST_LIST_TO_IDS(classOneList, idList)
#define CONST_CAST_LIST(classOneList, classTwoList, classTwo)

Define Documentation

#define CAST_LIST (   classOneList,
  classTwoList,
  classTwo 
)
Value:
{ \
      classTwo *CAST_LIST_PTR_TWO; \
      (classTwoList).clean_out(); \
      int CAST_LIST_IT_END = (classOneList).size(); \
      for (int CAST_LIST_IT=0; CAST_LIST_IT<CAST_LIST_IT_END; CAST_LIST_IT++) { \
  CAST_LIST_PTR_TWO = dynamic_cast<classTwo*>( (classOneList)[CAST_LIST_IT] ); \
        if (CAST_LIST_PTR_TWO != NULL) (classTwoList).append(CAST_LIST_PTR_TWO); \
      } \
   }

Definition at line 55 of file CastTo.hpp.

#define CAST_LIST_TO_IDS (   classOneList,
  idList 
)
Value:
{ \
      (classOneList).reset(); \
      (idList).clean_out(); \
      for (int i = (classOneList).size(); i > 0; i--) { \
        (idList).append((classOneList).get_and_step()->id()); \
      } \
   }

Definition at line 77 of file CastTo.hpp.

#define CAST_LIST_TO_PARENT (   classOneList,
  classTwoList 
)
Value:
{ \
      (classOneList).reset(); \
      (classTwoList).clean_out(); \
      (classTwoList).reserve((classOneList).size()); \
      for (int CAST_LIST_IT = (classOneList).size(); CAST_LIST_IT > 0; CAST_LIST_IT--) \
        (classTwoList).append((classOneList).get_and_step()); \
   }

Definition at line 46 of file CastTo.hpp.

#define CAST_TO (   classOnePtr,
  classTwo 
)    dynamic_cast<classTwo*>(classOnePtr)

Definition at line 40 of file CastTo.hpp.

#define CONST_CAST_LIST (   classOneList,
  classTwoList,
  classTwo 
)
Value:
{ \
      classTwo *CAST_LIST_PTR_TWO; \
      (classTwoList).clean_out(); \
      for (int CAST_LIST_IT = 0; CAST_LIST_IT < (classOneList).size(); CAST_LIST_IT++) { \
        CAST_LIST_PTR_TWO = dynamic_cast<classTwo*>( (classOneList).next(CAST_LIST_IT) ); \
        if (CAST_LIST_PTR_TWO != NULL) (classTwoList).append(CAST_LIST_PTR_TWO); \
      } \
   }

Definition at line 86 of file CastTo.hpp.

#define STATIC_CAST_LIST (   classOneList,
  classTwoList,
  classTwo 
)
Value:
{ \
      classTwo *CAST_LIST_PTR_TWO; \
      (classTwoList).clean_out(); \
      int CAST_LIST_IT_END = (classOneList).size(); \
      for (int CAST_LIST_IT=0; CAST_LIST_IT<CAST_LIST_IT_END; CAST_LIST_IT++) { \
  CAST_LIST_PTR_TWO = static_cast<classTwo*>( (classOneList)[CAST_LIST_IT] ); \
        if (CAST_LIST_PTR_TWO != NULL) (classTwoList).append(CAST_LIST_PTR_TWO); \
      } \
   }

Definition at line 66 of file CastTo.hpp.

#define STATIC_CAST_TO (   classOnePtr,
  classTwo 
)    static_cast<classTwo*>(classOnePtr)

Definition at line 43 of file CastTo.hpp.

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines