Develop Biology
The language of life
IdAndPerspectiveMacros.h File Reference
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define BIO_ID(className, dimension)   BIO_ID_WITH_PLURAL(className, className##s, dimension)
 
#define BIO_ID_FUNCTION_BODY(functionName, perspective, dimension)
 
#define BIO_ID_WITH_PERSPECTIVE(className, dimension)
 
#define BIO_ID_WITH_PERSPECTIVE_WITH_PLURAL(className, pluralName, dimension)
 
#define BIO_ID_WITH_PLURAL(className, pluralName, dimension)
 
#define BIO_PERSPECTIVE_SINGLETON(className, dimension)   BIO_SINGLETON(className, ::bio::physical::Perspective<dimension>)
 

Macro Definition Documentation

◆ BIO_ID

#define BIO_ID (   className,
  dimension 
)    BIO_ID_WITH_PLURAL(className, className##s, dimension)

Define a BIO_ID with "classNames" as plural (e.g. StandardDimensions)

Definition at line 41 of file IdAndPerspectiveMacros.h.

◆ BIO_ID_FUNCTION_BODY

#define BIO_ID_FUNCTION_BODY (   functionName,
  perspective,
  dimension 
)
Value:
dimension g_##functionName = (perspective).GetIdFromName(#functionName); \
dimension functionName() \
{ \
return g_##functionName; \
}

To make defining ids easier, use this macro to define the function body of your Id Function(). This will assign a value to a string that is identical to your FunctionName e.g. MyPerspective::Instance().GetNameFromId(Value()) would give "Value". Necessitates that functionName be a part of any namespaces are already specified (e.g. using namespace somewhere above a call to this macro).

Definition at line 49 of file IdAndPerspectiveMacros.h.

◆ BIO_ID_WITH_PERSPECTIVE

#define BIO_ID_WITH_PERSPECTIVE (   className,
  dimension 
)
Value:
BIO_ID(className, dimension) \
BIO_PERSPECTIVE_SINGLETON(className##Perspective, className);
#define BIO_ID(className, dimension)

This is the preferred design pattern if using singletons and a custom dimension

Definition at line 59 of file IdAndPerspectiveMacros.h.

◆ BIO_ID_WITH_PERSPECTIVE_WITH_PLURAL

#define BIO_ID_WITH_PERSPECTIVE_WITH_PLURAL (   className,
  pluralName,
  dimension 
)
Value:
BIO_ID_WITH_PLURAL(className, pluralName, dimension) \
BIO_PERSPECTIVE_SINGLETON(className##Perspective, className);
#define BIO_ID_WITH_PLURAL(className, pluralName, dimension)

For when the plural of className isn't "classNames" (e.g. Properties or Axes)

Definition at line 66 of file IdAndPerspectiveMacros.h.

◆ BIO_ID_WITH_PLURAL

#define BIO_ID_WITH_PLURAL (   className,
  pluralName,
  dimension 
)
Value:
BIO_STRONG_TYPEDEF(dimension, className, 0) \
typedef std::vector<className> pluralName;
#define BIO_STRONG_TYPEDEF(type, name, defaultValue)
Definition: StrongTypedef.h:37

Ease of use for defining Ids. For more on DIMENSIONs, Ids, etc., see Perspective.h and Identifiable.h

Definition at line 34 of file IdAndPerspectiveMacros.h.

◆ BIO_PERSPECTIVE_SINGLETON

#define BIO_PERSPECTIVE_SINGLETON (   className,
  dimension 
)    BIO_SINGLETON(className, ::bio::physical::Perspective<dimension>)

For ease of use for defining Singleton Perspectives.

Definition at line 27 of file IdAndPerspectiveMacros.h.