15#define OSG_VALUESTACK 1
21#define OSG_HAS_VALUESTACK
33 typedef std::vector< osg::ref_ptr<Object> >
Values;
51 _valuesMap[key].push_back(
new UserValueObject(value));
64 for(ValueMap::KeyValueMap::iterator itr = keyValueMap.begin();
65 itr != keyValueMap.end();
68 push(itr->first.get(), itr->second.get());
78 for(ValueMap::KeyValueMap::iterator itr = keyValueMap.begin();
79 itr != keyValueMap.end();
82 pop(itr->first.get());
89 ValueStackMap::iterator itr =
_valuesMap.find(key);
92 Values& values = itr->second;
93 if (values.empty())
return 0;
95 return values.back().get();
100 ValueStackMap::const_iterator itr =
_valuesMap.find(key);
103 const Values& values = itr->second;
104 if (values.empty())
return 0;
106 return values.back().get();
113 return (
object &&
typeid(*
object)==
typeid(T)) ?
static_cast<T*
>(object) : 0;
121 return (
object &&
typeid(*
object)==
typeid(T)) ?
static_cast<const T*
>(object) : 0;
131 value = uvo->getValue();
147 value = uvo->getValue();
The core osg library provides the basic scene graph classes such as Nodes, State and Drawables,...
Definition AlphaFunc:19
Copy Op(erator) used to control whether shallow or deep copy is used during copy construction and clo...
Definition CopyOp:41
@ SHALLOW_COPY
Definition CopyOp:47
Base class/standard interface for objects which require IO support, cloning and reference counting.
Definition Object:61
Object()
Construct an object.
Definition Object:69
Base class for providing reference counted objects.
Definition Referenced:44
KeyValueMap & getKeyValueMap()
Definition ValueMap:39
std::map< osg::ref_ptr< const osg::Referenced >, osg::ref_ptr< osg::Object > > KeyValueMap
Definition ValueMap:35
Definition ValueObject:283
void push(const Referenced *key, Object *value)
Definition ValueStack:42
ValueStackMap _valuesMap
Definition ValueStack:160
ValueStackMap & getValueStackMap()
Definition ValueStack:38
void pop(const Referenced *key)
Definition ValueStack:54
T * getValueOfType(const osg::Referenced *key)
Definition ValueStack:110
void push(const osg::Referenced *key, const T &value)
Definition ValueStack:48
void pop(ValueMap *valueMap)
Definition ValueStack:73
ValueStack(const ValueStack &ps, const osg::CopyOp ©op=osg::CopyOp::SHALLOW_COPY)
bool getValue(const osg::Referenced *key, T &value) const
Definition ValueStack:141
std::map< osg::ref_ptr< const osg::Referenced >, Values > ValueStackMap
Definition ValueStack:34
bool getValue(const osg::Referenced *key, T &value)
Definition ValueStack:125
const T * getValueOfType(const osg::Referenced *key) const
Definition ValueStack:118
const ValueStackMap & getValueStackMap() const
Definition ValueStack:40
std::vector< osg::ref_ptr< Object > > Values
Definition ValueStack:33
void setValueStackMap(ValueStackMap &pm)
Definition ValueStack:36
void push(ValueMap *valueMap)
Definition ValueStack:59
const osg::Object * getValue(const osg::Referenced *key) const
Definition ValueStack:98
META_Object(osg, ValueStack)
osg::Object * getValue(const osg::Referenced *key)
Definition ValueStack:87
#define OSG_EXPORT
Definition Export:39