AGX Dynamics
2.38.0.2
AttributeContainer.h
Go to the documentation of this file.
1
/*
2
Copyright 2007-2024. Algoryx Simulation AB.
3
4
All AGX source code, intellectual property, documentation, sample code,
5
tutorials, scene files and technical white papers, are copyrighted, proprietary
6
and confidential material of Algoryx Simulation AB. You may not download, read,
7
store, distribute, publish, copy or otherwise disseminate, use or expose this
8
material unless having a written signed agreement with Algoryx Simulation AB, or having been
9
advised so by Algoryx Simulation AB for a time limited evaluation, or having purchased a
10
valid commercial license from Algoryx Simulation AB.
11
12
Algoryx Simulation AB disclaims all responsibilities for loss or damage caused
13
from using this software, unless otherwise stated in written agreements with
14
Algoryx 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
26
namespace
agxData
27
{
31
class
AGXCORE_EXPORT
AttributeContainer
32
{
33
public
:
34
AttributeContainer
();
35
~
AttributeContainer
();
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
:
58
typedef
agx::HashTable<AttributeConstRef, void *>
ScalarAttributeTable
;
59
mutable
ScalarAttributeTable
m_attributeTable;
60
};
61
62
63
/* Implementation */
64
template
<
typename
T>
65
T&
AttributeContainer::getAttribute
(
const
ScalarAttributeT<T>
*attribute)
66
{
67
return
*
static_cast<
T *
>
(this->
getAttribute
(
static_cast<
const
Attribute
*
>
(attribute)));
68
}
69
70
template
<
typename
T>
71
const
T&
AttributeContainer::getAttribute
(
const
ScalarAttributeT<T>
*attribute)
const
72
{
73
return
const_cast<
AttributeContainer
*
>
(
this
)->
getAttribute
(attribute);
74
}
75
76
}
77
78
79
#endif
/* _AGXDATA_ATTRIBUTECONTAINER_H_ */
AGXCORE_EXPORT
#define AGXCORE_EXPORT
agxData::ScalarAttributeT
Definition:
Attribute.h:279
Allocator.h
HashTable.h
agxData::AttributeContainer::getAttribute
void * getAttribute(const Attribute *attribute)
agxData
Contains classes for low level data storage for AGX.
Definition:
Container.h:23
agx::LinearProbingHashTable
Inheritance with partial specialization due to bug with ref_ptr containers.
Definition:
LinearProbingHashTable.h:926
agxCore_export.h
agx.h
agxData::AttributeContainer
An attribute container.
Definition:
AttributeContainer.h:31
agxData::Attribute
An abstract attribute description, part of an Entity.
Definition:
Attribute.h:57
Attribute.h
include
agxData
AttributeContainer.h
Generated on Sun Sep 1 2024 11:18:22 for AGX Dynamics by
1.8.17