Gyoto
Classes | Namespaces | Macros
GyotoObject.h File Reference

Introspectable objects. More...

#include "GyotoConfig.h"
#include <string>
#include <vector>

Go to the source code of this file.

Classes

class  Gyoto::Object
 Object with properties. More...
 

Namespaces

 Gyoto
 Namespace for the Gyoto library.
 

Macros

#define GYOTO_OBJECT_ACCESSORS_STRING(method)
 Declare a pair of accessors to string member in a class declaration. More...
 
#define GYOTO_OBJECT_ACCESSORS(type, method)
 Declare a pair of accessors to scalar member in a class declaration. More...
 
#define GYOTO_OBJECT_ACCESSORS_UNIT(method)
 Declare a quadruplet of accessors to double member that supports unit. More...
 
#define GYOTO_OBJECT
 Declare class::properties and class::getProperties() More...
 

Detailed Description

Introspectable objects.

Introspectbale objects.

Macro Definition Documentation

#define GYOTO_OBJECT
Value:
static Property const properties[]; \
virtual Property const * getProperties() const

Declare class::properties and class::getProperties()

Any derived class that does define Properties (i.e. the macro GYOTO_PROPERTY_START() is called somewhere in the .C file) must call the GYOTO_OBJECT macro in a "public:" section of the class declaration. Else, the property list is inherited from the direct parent, and calling GYOTO_PROPERTY_START() in the .C file leads to a compile-time error.

#define GYOTO_OBJECT_ACCESSORS (   type,
  method 
)
Value:
virtual void method(type); \
virtual type method() const;

Declare a pair of accessors to scalar member in a class declaration.

The accessors must also be defined in the .C file, which can be done using GYOTO_PROPERTY_ACCESSORS

Parameters
typedata type of the memebr beeing accessed. Any scalar type (double, long, size_t, SmartPointer<Metric::Generic> etc).
methodname of the accessors.
#define GYOTO_OBJECT_ACCESSORS_STRING (   method)
Value:
virtual void method(std::string const&); \
virtual std::string method() const;

Declare a pair of accessors to string member in a class declaration.

The accessors must also be defined in the .C file

Parameters
methodname of the accessors.
#define GYOTO_OBJECT_ACCESSORS_UNIT (   method)
Value:
GYOTO_OBJECT_ACCESSORS(double, method) \
virtual void method(double, std::string const &); \
virtual double method(std::string const &) const;
#define GYOTO_OBJECT_ACCESSORS(type, method)
Declare a pair of accessors to scalar member in a class declaration.
Definition: GyotoObject.h:59

Declare a quadruplet of accessors to double member that supports unit.

The accessors must also be defined in the .C file.

Parameters
methodname of the accessors.