GyotoObject.h File Reference

Introspectable objects. More...

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

Go to the source code of this file.

Classes

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

Namespaces

namespace  Gyoto
 

Namespace for the Gyoto library.


Defines

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

Detailed Description

Introspectable objects.


Define Documentation

#define GYOTO_OBJECT
Value:
static Property const  properties[];                    \
  virtual Property const * getProperties() const;       \
  static const std::string builtinPluginValue;          \
  virtual void plugins(std::vector<std::string> const & plugname);      \
  virtual std::vector<std::string> plugins() 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:
type data type of the memebr beeing accessed. Any scalar type (double, long, size_t, SmartPointer<Metric::Generic> etc).
method name 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:
method name 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;

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

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

Parameters:
method name of the accessors.
#define GYOTO_OBJECT_THREAD_SAFETY   virtual bool isThreadSafe() const

Declare virtual bool isThreadSafe() const.

Use this to declare that the object is not (or not always) thread safe. The corresponding definition of isThreadSafe() must exist. If the object is always thread unsafe (e.g. Lorene Metrics of Python based objects), you can simply use GYOTO_PROPERTY_THREAD_SAFETY in the corresponding .C file.


Generated on 6 May 2017 for Gyoto by  doxygen 1.6.1