AGX Dynamics 2.41.3.2
Loading...
Searching...
No Matches
AttributeContainer.h
Go to the documentation of this file.
1/*
2Copyright 2007-2025. Algoryx Simulation AB.
3
4All AGX source code, intellectual property, documentation, sample code,
5tutorials, scene files and technical white papers, are copyrighted, proprietary
6and confidential material of Algoryx Simulation AB. You may not download, read,
7store, distribute, publish, copy or otherwise disseminate, use or expose this
8material unless having a written signed agreement with Algoryx Simulation AB, or having been
9advised so by Algoryx Simulation AB for a time limited evaluation, or having purchased a
10valid commercial license from Algoryx Simulation AB.
11
12Algoryx Simulation AB disclaims all responsibilities for loss or damage caused
13from using this software, unless otherwise stated in written agreements with
14Algoryx Simulation AB.
15*/
16
17#ifndef AGXDATA_ATTRIBUTECONTAINER_H
18#define AGXDATA_ATTRIBUTECONTAINER_H
19
20#include <agx/agx.h>
21#include <agxData/Attribute.h>
22#include <agx/agxCore_export.h>
23#include <agx/Allocator.h>
24#include <agx/HashTable.h>
25
26namespace agxData
27{
32 {
33 public:
36
40 void *getAttribute(const Attribute *attribute);
41 const void *getAttribute(const Attribute *attribute) const;
42
43
44 // Templated accessors
45 template <typename T>
46 T& getAttribute(const ScalarAttributeT<T> *attribute);
47
48 template <typename T>
49 const T& getAttribute(const ScalarAttributeT<T> *attribute) const;
50
51
55 bool hasAttribute(const Attribute *attribute) const;
56
57 private:
59 mutable ScalarAttributeTable m_attributeTable;
60 };
61
62
63 /* Implementation */
64 template <typename T>
66 {
67 return *static_cast<T *>(this->getAttribute(static_cast<const Attribute *>(attribute)));
68 }
69
70 template <typename T>
72 {
73 return const_cast<AttributeContainer *>(this)->getAttribute(attribute);
74 }
75
76}
77
78
79#endif /* _AGXDATA_ATTRIBUTECONTAINER_H_ */
#define AGXCORE_EXPORT
An attribute container.
const void * getAttribute(const Attribute *attribute) const
bool hasAttribute(const Attribute *attribute) const
void * getAttribute(const Attribute *attribute)
An abstract attribute description, part of an Entity.
Definition: Attribute.h:58
Inheritance with partial specialization due to bug with ref_ptr containers.
Contains classes for low level data storage for AGX.
Definition: Container.h:23