Object.h File Reference

Contains the interface of the Object class. More...

#include <iterator>
#include <stack>
#include <libpf/persistency/Node.h>
#include <libpf/value/Value.h>

Classes

class  Object
 A Node with Quantity, String and Integer variables. More...
 
class  Object::IteratorQuantities
 
class  Object::ConstIteratorQuantities
 
class  Object::RangeQuantities
 
class  Object::ConstRangeQuantities
 

Macros

#define QUANTITY(tag, ...)   Quantity tag = Quantity(#tag, __VA_ARGS__)
 use this macro to initialize a Quantity variable in the class declaration using a C++11 non-static data member initializer More...
 
#define STRING(tag, ...)   String tag = String(#tag, __VA_ARGS__)
 use this macro to initialize a String parameter in the class declaration using a C++11 non-static data member initializer More...
 
#define STRINGVECTOR(tag, ...)   StringVector tag = StringVector(#tag, __VA_ARGS__)
 use this macro to initialize a StringVector parameter in the class declaration using a C++11 non-static data member initializer More...
 
#define INTEGER(tag, ...)   Integer tag = Integer(#tag, __VA_ARGS__)
 use this macro to initialize a Integer parameter in the class declaration using a C++11 non-static data member initializer More...
 
#define INTEGERVECTOR(tag, ...)   IntegerVector tag = IntegerVector(#tag, __VA_ARGS__)
 use this macro to initialize a IntegerVector parameter in the class declaration using a C++11 non-static data member initializer More...
 
#define DEFINE(tag, ...)   tag(#tag, __VA_ARGS__, this)
 use this macro to initialize variables and parameters in the universal constructor More...
 
#define GENERATE_COPY_MOVE(ClassName)
 use this macro in top-level, non-abstract classes to enable convenience constructors, copy / move constructors and assignments More...
 
#define GENERATE_COPY_MOVE_BASE(ClassName)
 use this macro in mid-level, semi-abstract classes to enable copy / move assignments More...
 
#define GENERATE_COPY_MOVE_DERIVED(ClassName, Base)
 
#define NON_COPYABLE(ClassName)
 use this macro to disable copy assignment / construction More...
 

Detailed Description

Contains the interface of the Object class.

This file is part of LIBPF All rights reserved; do not distribute without permission.

Author
(C) Copyright 2004-2023 Paolo Greppi simevo s.r.l.

Macro Definition Documentation

◆ DEFINE

#define DEFINE (   tag,
  ... 
)    tag(#tag, __VA_ARGS__, this)

use this macro to initialize variables and parameters in the universal constructor

◆ GENERATE_COPY_MOVE

#define GENERATE_COPY_MOVE (   ClassName)
Value:
ClassName(const ClassName &other) : ClassName(other.defaults()) { Object::operator=(other); addVariables(); } \
inline ClassName(const std::string &tag="", const std::string &description="") : ClassName(Libpf::Persistency::Defaults(tag, description)) { } \
inline ClassName(uint32_t id, Persistency *persistency) : ClassName(Libpf::Persistency::Defaults(), id, persistency, nullptr, nullptr) { } \
ClassName(ClassName &&other) : ClassName(other.defaults()) { Object::operator=(other); addVariables(); } \
std::unique_ptr<Node> clone(void) const override { return std::unique_ptr<Node>(new ClassName(*this)); } \
ClassName &operator=(const ClassName &other) { Object::operator=(other); return *this; } \
ClassName &operator=(ClassName &&other) { Object::operator=(other); return *this; }
Object & operator=(const Object &)
copy assignment operator
Pesistent storage management class.
Definition: Persistency.h:89
Definition: Enumerator.h:30

use this macro in top-level, non-abstract classes to enable convenience constructors, copy / move constructors and assignments

◆ GENERATE_COPY_MOVE_BASE

#define GENERATE_COPY_MOVE_BASE (   ClassName)
Value:
virtual ClassName &operator=(const ClassName &other) = 0; \
std::unique_ptr<Node> clone(void) const override = 0; \
virtual ClassName &operator=(ClassName &&other) = 0;

use this macro in mid-level, semi-abstract classes to enable copy / move assignments

◆ GENERATE_COPY_MOVE_DERIVED

#define GENERATE_COPY_MOVE_DERIVED (   ClassName,
  Base 
)
Value:
Base &operator=(const Base &other) override { Object::operator=(other); return *this; } \
Base &operator=(Base &&other) override { Object::operator=(other); return *this; }

use this macro in top-level, non-abstract classes to enable copy / move assignments from references to the Base class; must use GENERATE_COPY_MOVE_BASE in Base class

◆ INTEGER

#define INTEGER (   tag,
  ... 
)    Integer tag = Integer(#tag, __VA_ARGS__)

use this macro to initialize a Integer parameter in the class declaration using a C++11 non-static data member initializer

◆ INTEGERVECTOR

#define INTEGERVECTOR (   tag,
  ... 
)    IntegerVector tag = IntegerVector(#tag, __VA_ARGS__)

use this macro to initialize a IntegerVector parameter in the class declaration using a C++11 non-static data member initializer

◆ NON_COPYABLE

#define NON_COPYABLE (   ClassName)
Value:
ClassName &operator=(const ClassName&) = delete; \
ClassName(const ClassName&) = delete;

use this macro to disable copy assignment / construction

◆ QUANTITY

#define QUANTITY (   tag,
  ... 
)    Quantity tag = Quantity(#tag, __VA_ARGS__)

use this macro to initialize a Quantity variable in the class declaration using a C++11 non-static data member initializer

◆ STRING

#define STRING (   tag,
  ... 
)    String tag = String(#tag, __VA_ARGS__)

use this macro to initialize a String parameter in the class declaration using a C++11 non-static data member initializer

◆ STRINGVECTOR

#define STRINGVECTOR (   tag,
  ... 
)    StringVector tag = StringVector(#tag, __VA_ARGS__)

use this macro to initialize a StringVector parameter in the class declaration using a C++11 non-static data member initializer