 |
AGXDynamics
2.35.0.3
|
Go to the documentation of this file.
17 #ifndef AGXDATA_VALUE_H
18 #define AGXDATA_VALUE_H
25 namespace agxNet {
class Device; }
48 virtual void configure(agx::TiXmlElement *eValue)
override;
49 virtual void save(agx::TiXmlElement *eParent)
const override;
50 virtual void snapshot(agx::TiXmlNode *eParent,
const agx::String& directory)
const override;
63 void addListener(EventListener *listener);
64 void removeListener(EventListener *listener);
65 bool hasListener(EventListener *listener);
78 const void *ptr()
const;
89 void set(
const Value *other);
93 void set(
const T& value);
100 void signal(
const T& value);
106 void setDefaultValue();
130 const Value *getBinding()
const;
135 Value *getRootBinding();
136 const Value *getRootBinding()
const;
152 void bind(
Value *binding);
157 void unbind(
bool removeAutoBindPath =
true);
162 virtual void rebind()
override;
167 bool isValid()
const;
173 bool isTypeCompatible(
const Value *other);
175 Value *clone()
const;
176 static void copy(
Value *target,
const Value *source);
179 void set(
Value *other);
188 virtual void buildNavigationTree(agxJson::Value& eNode)
const override;
192 virtual bool bind(Object *
object);
197 friend class agxNet::Device;
199 void set(
const void *value);
200 void setStorage(
void *ptr);
201 void propagateUpdate();
203 static void allocate(
Value *value);
204 static void deallocate(
Value *value);
208 void forceInvalidateDefaultFormatValue();
229 template <
typename T>
233 template <
typename T2>
238 ValueT(
const T& value = T());
244 operator const T& ()
const;
246 void set(
const T& value);
247 void signal(
const T& value);
248 const T&
get()
const;
255 template <
typename T>
277 template <
typename T>
324 template <
typename T>
332 template <
typename T>
342 this->
set(
const_cast<const Value *
>(other));
355 template <
typename T>
359 this->
setFormat(agxData::getFormat<T>());
362 this->
set((
const void *)&value);
365 template <
typename T>
399 template <
typename T>
template <
typename T2>
402 const Value *value =
dynamic_cast<const Value *
>(object);
403 return value ? value->
getFormat() == agxData::getFormat<T>() :
false;
407 template <
typename T>
413 template <
typename T>
419 template <
typename T>
425 template <
typename T>
431 template <
typename T>
434 template <
typename T>
440 template <
typename T>
443 Value::signal(value);
447 template <
typename T>
450 agxAssertN(this->isValid(),
"Can not dereference an invalid value (%s)!", this->getPath().c_str());
451 return *(
const T*)Value::ptr();
454 template <
typename T>
457 this->operator=(value.
get());
461 template <
typename T>
agxData::Type * getType()
agx::Event1< Value * > Event
Abstract representation of a value.
agx::Object * getContext()
agx::ref_ptr< ValueT< T > > RefT
void AGXCORE_EXPORT transform(void *target, const Format *targetFormat, const void *source, const Format *sourceFormat, size_t numElements)
Transform data between two buffers.
AGXCORE_EXPORT Format * getFormat(const agx::String &typeFormatName)
ValueT< T > * operator->() const
ValueT< T > & operator=(const ValueT< T > &value)
Val(const agx::Name &name)
Representation of a path, a list of name components.
ValuePtrVector m_children
agx::UInt32 m_allocationIndex
AGXCORE_EXPORT Type * getType(const agx::String &name)
EventListener m_bindingListener
Val< T > & operator=(const Val< T > &value)
void setFormat(agxData::Format *format)
Abstract representation of a scalar variable.
static bool ValidateCast(const agx::Referenced *object)
EventDispatch m_eventDispatch
ValueT(const agx::Name &name)
Contains classes for low level data storage for AGX.
agx::HashTable< agx::String, ValueRef > ValueTable
A model is an abstract representation of the class of an agx::Object.
Val(const agx::Name &name, const T &value)
#define AGX_DECLARE_VECTOR_TYPES(type)
const T * operator->() const
void signal(const T &value)
void signal(const T &value)
Wrapper for this->getRootBinding()->set()
agxData::Format * getFormat()
Inheritance with partial specialization due to bug with ref_ptr containers.
ValueRefT(ValueT< T > *val)
Representation of a name string.
agx::Object is a refcounted object with a name.
bool AGXCORE_EXPORT isShutdown()
Base class providing referencing counted objects.
#define AGX_DECLARE_POINTER_TYPES(type)
Event updateEvent
Triggered when the value is updated.
Templated value-reference.
const agx::Path & getBindPath() const
An agx::Device is an abstract representation of a device on which data can be stored and processed.
#define agxAssertN(expr, format,...)
void set(const Value *other)
Explicitly set the value, removes active binding and disables autobinding.
ValueT< T > & operator*() const
void reference(void *ptr=nullptr) const
Explicitly increment the reference count by one, indicating that this object has another pointer whic...
const agx::Name & getName() const
std::ostream & operator<<(std::ostream &output, const Attribute &attribute)
Only use as member allocated variable.
Containins classes for sending/reading data over sockets as well as compression functionality.
ValueT< T > * get() const