openDAQ
Open data acquisition platform
TypeManagerPtr Class Reference

Container for Type objects. The Type manager is used when creating certain types of objects (eg. Structs and Property object classes). The Types stored within the manager contain pre-defined fields, as well as constraints specifying how objects should look. More...

+ Inheritance diagram for TypeManagerPtr:
+ Collaboration diagram for TypeManagerPtr:

Detailed Description

Container for Type objects. The Type manager is used when creating certain types of objects (eg. Structs and Property object classes). The Types stored within the manager contain pre-defined fields, as well as constraints specifying how objects should look.

The currently available types in openDAQ that should be added to the Type manager are the Struct type and the Property object class. The former is used to validate Structs when they are created, while the latter contains pre-defined properties that are added to Property objects on construction.

When adding a Property object class to the manager, they can form inheritance chains with one-another. Thus, a parent of a given class must be added to the manager before any of its children. Likewise, a class cannot be removed before its children are removed.

Public Member Functions

void addType (const TypePtr &type) const
 Adds a type to the manager. More...
 
void removeType (const StringPtr &name) const
 Removes the type from the manager. More...
 
TypePtr getType (const StringPtr &name) const
 Gets an added Type by name. More...
 
ListPtr< IStringgetTypes () const
 Gets a list of all added Types. More...
 
Bool hasType (const StringPtr &typeName) const
 Checks if a type with the specified name is already added. More...
 
 ObjectPtr ()
 Creates a smart pointer with no wrapped interface.
 
 ObjectPtr (std::nullptr_t)
 Creates a smart pointer with no wrapped interface.
 
 ObjectPtr (const ObjectPtr< T > &objPtr)
 Creates a smart pointer from another smart pointer. More...
 
 ObjectPtr (ObjectPtr< T > &&objPtr) noexcept
 Creates a smart pointer from another smart pointer with move semantics. More...
 
template<class U >
 ObjectPtr (const ObjectPtr< U > &objPtr)
 Creates a smart pointer from another smart pointer of a different interface type. More...
 
template<class U >
 ObjectPtr (ObjectPtr< U > &&objPtr)
 Creates a smart pointer from another smart pointer of a different interface type with move semantics. More...
 
 ObjectPtr (T *&obj)
 Creates a smart pointer from an interface pointer. More...
 
 ObjectPtr (T *&&obj)
 Creates a smart pointer from an interface pointer with move semantics. More...
 
 ObjectPtr (IWeakRef *obj)
 Creates a smart pointer from a weak reference interface pointer. More...
 
 ObjectPtr (const wchar_t *value)
 Creates a string object smart pointer from UTF16 null terminated sequence. More...
 
 ObjectPtr (ConstCharPtr value)
 Creates a string object smart pointer from UTF8 null terminated sequence. More...
 
template<typename U , std::enable_if_t< is_ct_conv< U >::value &&!std::is_enum_v< U >, int > = 0>
 ObjectPtr (const U &value)
 Creates a smart pointer wrapper from value type. More...
 
- Public Member Functions inherited from ObjectPtr< ITypeManager >
 ObjectPtr ()
 Creates a smart pointer with no wrapped interface.
 
 ObjectPtr (std::nullptr_t)
 Creates a smart pointer with no wrapped interface.
 
 ObjectPtr (const ObjectPtr< ITypeManager > &objPtr)
 Creates a smart pointer from another smart pointer. More...
 
 ObjectPtr (ObjectPtr< ITypeManager > &&objPtr) noexcept
 Creates a smart pointer from another smart pointer with move semantics. More...
 
 ObjectPtr (const ObjectPtr< U > &objPtr)
 Creates a smart pointer from another smart pointer of a different interface type. More...
 
 ObjectPtr (ObjectPtr< U > &&objPtr)
 Creates a smart pointer from another smart pointer of a different interface type with move semantics. More...
 
 ObjectPtr (ITypeManager *&obj)
 Creates a smart pointer from an interface pointer. More...
 
 ObjectPtr (ITypeManager *&&obj)
 Creates a smart pointer from an interface pointer with move semantics. More...
 
 ObjectPtr (IWeakRef *obj)
 Creates a smart pointer from a weak reference interface pointer. More...
 
 ObjectPtr (const wchar_t *value)
 Creates a string object smart pointer from UTF16 null terminated sequence. More...
 
 ObjectPtr (ConstCharPtr value)
 Creates a string object smart pointer from UTF8 null terminated sequence. More...
 
 ObjectPtr (const U &value)
 Creates a smart pointer wrapper from value type. More...
 
virtual ~ObjectPtr ()
 Destructor. More...
 
bool equals (ObjectPtr< IBaseObject > other) const
 Compares object to another object for equality. More...
 
ITypeManagerdetach ()
 Disassociates this smart pointer object from the interface that it represents. More...
 
void dispose () const
 Disposes all references held by the object. More...
 
void release ()
 Resets the wrapped interface to nullptr. More...
 
ITypeManageraddRefAndReturn () const
 Increments the reference count and returns the interface. More...
 
 operator ITypeManager * () const
 Casts the pointer to the wrapped interface. More...
 
bool assigned () const
 Checks if the smart pointer is not empty.
 
ITypeManagergetObject () const
 Gets the pointer to the wrapped interface. More...
 
ITypeManager ** addressOf ()
 Gets the address of the pointer to the wrapped interface. More...
 
ITypeManager ** operator& ()
 Gets the address of the pointer to the wrapped interface. More...
 
U * as (bool borrow=false) const
 Casts the wrapped interface to another interface. More...
 
U * asOrNull (bool borrow=false) const
 Casts the wrapped interface to another interface. More...
 
Ptr asPtr (bool borrow=false) const
 Casts the wrapped interface to another interface and wraps in a smart pointer. More...
 
Ptr asPtrOrNull (bool borrow=false) const
 Casts the wrapped interface to another interface and wraps in a smart pointer. More...
 
bool supportsInterface () const
 Checks if the wrapped interface supports another interface. More...
 
bool supportsInterface (const IntfID &id) const
 Checks if the wrapped interface supports another interface using the interface ID. More...
 
CoreType getCoreType () const
 Gets the object's CoreType. More...
 
ObjectPtr< IBaseObjectconvertTo (CoreType ct) const
 Converts the object to the specified CoreType. More...
 
SizeT getHashCode () const
 Returns hash code of the object. More...
 
ObjectPtr< IStringtoString () const
 Converts the object to the string object. More...
 
void freeze () const
 Freezes the object. More...
 
Bool isFrozen () const
 Checks if the object is frozen. More...
 
void dispatch (const ObjectPtr< IBaseObject > &params) const
 Calls the stored callback. More...
 
void dispatch () const
 Calls the stored callback without any parameters. More...
 
void execute () const
 Calls the stored callback without any parameters. More...
 
void execute (Params... params) const
 Calls the stored callback. More...
 
ObjectPtr< IBaseObjectcall (Params... params) const
 Calls the stored callback and returns the result. More...
 
bool isBorrowed () const
 Checks if the reference is borrowed. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from ObjectPtr< ITypeManager >
static InterfaceToSmartPtr< U >::SmartPtr Borrow (ITypeManager *&obj)
 Borrows an interface. More...
 
static InterfaceToSmartPtr< V >::SmartPtr Borrow (U *&obj)
 Borrows an interface from the interface of another type. More...
 
static InterfaceToSmartPtr< U >::SmartPtr Adopt (ITypeManager *obj)
 Adopts an interface. More...
 
static Bool Equals (const ObjectPtr< IBaseObject > &a, const ObjectPtr< IBaseObject > &b)
 Value based comparison of two objects. If both objects are nullptr, they are considered to be equal. More...
 

Member Function Documentation

◆ ObjectPtr() [1/10]

Creates a smart pointer from another smart pointer.

Parameters
objPtrThe source smart pointer with the same type of wrapped interface.

◆ ObjectPtr() [2/10]

ObjectPtr ( class U  )

Creates a smart pointer from another smart pointer of a different interface type.

Parameters
objPtrThe source smart pointer with a different type of wrapped interface.

◆ ObjectPtr() [3/10]

ObjectPtr ( typename U  ,
std::enable_if_t< is_ct_conv< U >::value &&!std::is_enum_v< U >, int >  = 0 
)

Creates a smart pointer wrapper from value type.

Parameters
valueThe value.

Value can be any type that has interface wrapper, such as Int, Bool, Float, uint16_t, float, double, etc...

◆ ObjectPtr() [4/10]

Creates a string object smart pointer from UTF16 null terminated sequence.

Parameters
valueThe UTF16 null terminated sequence.

◆ ObjectPtr() [5/10]

Creates a string object smart pointer from UTF8 null terminated sequence.

Parameters
valueThe UTF8 null terminated sequence.

◆ ObjectPtr() [6/10]

Creates a smart pointer from a weak reference interface pointer.

Parameters
objThe weak reference interface pointer.

If the object that the weak reference interface pointer represents does not exist anymore, the smart pointer sets the wrapped interface to nullptr.

◆ ObjectPtr() [7/10]

ObjectPtr
noexcept

Creates a smart pointer from another smart pointer with move semantics.

Parameters
objPtrThe source smart pointer with the same type of wrapped interface.

Source smart pointer is moved into the smart pointer. The Reference count is not incremented.

◆ ObjectPtr() [8/10]

ObjectPtr ( class U  )

Creates a smart pointer from another smart pointer of a different interface type with move semantics.

Parameters
objPtrThe source smart pointer with a different type of wrapped interface.

Source smart pointer is moved into the smart pointer. The Reference count is not incremented.

◆ ObjectPtr() [9/10]

Creates a smart pointer from an interface pointer with move semantics.

Parameters
objThe interface pointer.

The reference count is not incremented.

◆ ObjectPtr() [10/10]

Creates a smart pointer from an interface pointer.

Parameters
objThe interface pointer.

The reference count is incremented.