DataObjectPtr Class Reference
Last update: 16.07.2025A shared pointer wrapper for data objects. More...
Public Types | |
| typedef DataObject | Base |
| the data type | |
| typedef boost::weak_ptr< DataObject > | ObserverPtr |
| an observer for the shared pointer type | |
| typedef std::list< ObserverPtr > | ObserverPtrList |
| A list of observer pointers. | |
| typedef boost::shared_ptr< DataObject > | Ptr |
| the shared pointer type | |
| typedef string | string_type |
| a string type | |
Public Member Functions | |
| bool | operator!= (std::nullptr_t) |
| bool | operator== (std::nullptr_t) |
Access | |
| Base | operator* () |
| Base * | operator-> () |
| Base * | operator-> () |
Modifier | |
| DataObjectKey | ident () |
| setDescription (string_type description) | |
| Set the description of this DataObject, as displayed in the GUI's Quantity Information pane. More... | |
| generateDescription (Structure database) | |
| (Re)Generates the description string based on all available META data More... | |
| setActive () | |
| Sets the DataObject active. | |
| setInactive () | |
| Sets the DataObject inactive. More... | |
Operations | |
Miscellaneous methods | |
| bool | isValid () |
| DataObjectPtr | getMissingData () |
| Converts the missing data information of this object to a regular new data object. More... | |
| DataObjectPtr | getFullData () |
| Extracts the value data of this object and copies it to another object by marking all items as non-missing (takes the interpolated value) More... | |
| Matrix | getData () |
| Gives access to the encapsulated data by copying it into TMATH matrix object. More... | |
Friends | |
| class | DataObject |
| class | DataObjectDependencies |
Detailed Description
A shared pointer wrapper for data objects.
SoS acts mainly on shared pointers. This reduces memory consumption and computing time when passing objects to various software components. Furthermore, SoS should protect data manipulation once data gets added to the database. Write access should be limited to meta information only, e.g. dependencies, active state, ...
This class is such a encapsulating shared pointer including the following functionality:
- It manages the dependency information of data objects. This information cannot be treated by the objects themselves (because they do not know the reference to the boost_shared_ptr). Hence the shared_ptr itself must treat the dependencies on other objects.
- When submitting the dependency information to the constructor, it is sufficient to set the master objects
- If you want to add dependencies after creating the pointer object, you must append the connections to the list of masters AND slaves of the respective object pairs.
- Once a pointer object is created, write access to the underlying data object should be limited to properties only. Therefore its envisaged to remove all non accessors.
Member Function Documentation
◆ generateDescription()
| generateDescription | ( | Structure | database | ) |
(Re)Generates the description string based on all available META data
- Parameters
-
database The database used
◆ getData()
| Matrix getData | ( | ) |
Gives access to the encapsulated data by copying it into TMATH matrix object.
- Returns
- A new TMATH column vector containing the data of this data object.
◆ getFullData()
| DataObjectPtr getFullData | ( | ) |
Extracts the value data of this object and copies it to another object by marking all items as non-missing (takes the interpolated value)
- Returns
- A temporary copy to the extracted data
◆ getMissingData()
| DataObjectPtr getMissingData | ( | ) |
Converts the missing data information of this object to a regular new data object.
The missing data information of this object is COPIED to a new data object instance, including a new dependency object with this object set to master
- Returns
- a shared pointer of a data object representing the missing data of this object
◆ ident()
| DataObjectKey ident | ( | ) |
- Returns
- Get the DataObjectKey, containing the design ID and quantity ID of this DataObject
◆ isValid()
| bool isValid | ( | ) |
- Returns
- true if the pointer is valid
◆ operator!=()
| bool operator!= | ( | std::nullptr_t | ) |
- Returns
- true if the pointer is valid
◆ operator*()
| Base operator* | ( | ) |
- Returns
- a reference to the wrapped object,
- See also
- ref()
◆ operator->() [1/2]
| Base* operator-> | ( | ) |
- Returns
- A pointer to the wrapped object
- Deprecated:
- Do not use this method, as it is intended to be removed soon!
◆ operator->() [2/2]
| Base* operator-> | ( | ) |
- Returns
- a pointer to the wrapped object
- Deprecated:
- Do NOT even THING it to use this method! It will be definitely removed soon!
◆ operator==()
| bool operator== | ( | std::nullptr_t | ) |
- Returns
- true if the pointer is not valid
◆ setDescription()
| setDescription | ( | string_type | description | ) |
Set the description of this DataObject, as displayed in the GUI's Quantity Information pane.
- Parameters
-
description The new description
◆ setInactive()
| setInactive | ( | ) |
Sets the DataObject inactive.
- Parameters
-
database The database where all data are stored
- Note
- The method marks all slave objects as "needs update"