Manages the mapping of gradient names to IGradient objects. More...
#include <SGradientPool.h>
Public Member Functions | |
IGradient * | GetGradient (const SStringW &strName) |
Retrieves the gradient object by its name. | |
BOOL | Init (SXmlNode xmlNode) |
Initializes the gradient pool from an XML node. | |
![]() | |
SCmnMap (void(*funOnKeyRemoved)(const SAutoRefPtr< IGradient > &)=NULL) | |
Constructor. | |
virtual | ~SCmnMap () |
Destructor. | |
bool | HasKey (const SStringW &key) const |
Checks if a key exists in the map. | |
bool | GetKeyObject (const SStringW &key, SAutoRefPtr< IGradient > &obj) const |
Retrieves an object associated with a key. | |
SAutoRefPtr< IGradient > & | GetKeyObject (const SStringW &key) const |
Retrieves an object associated with a key. | |
bool | AddKeyObject (const SStringW &key, const SAutoRefPtr< IGradient > &obj) |
Adds a key-object pair to the map. | |
void | SetKeyObject (const SStringW &key, const SAutoRefPtr< IGradient > &obj) |
Sets an object for a key, replacing any existing object. | |
bool | RemoveKeyObject (const SStringW &key) |
Removes a key-object pair from the map. | |
void | RemoveAll () |
Removes all key-object pairs from the map. | |
size_t | GetCount () |
Gets the number of key-object pairs in the map. | |
![]() | |
TObjRefImpl () | |
Constructor that initializes the reference count to 1. | |
virtual | ~TObjRefImpl () |
Virtual destructor. | |
long | AddRef () override |
Increments the reference count. | |
long | Release () override |
Decrements the reference count and deletes the object if the count reaches zero. | |
void | OnFinalRelease () override |
Deletes the object. | |
![]() | |
long | AddRef () PURE |
Increases the reference count. | |
long | Release () PURE |
Decreases the reference count. | |
void | OnFinalRelease () PURE |
Called when the reference count reaches zero and the object is about to be released. | |
Additional Inherited Members | |
![]() | |
void(* | m_pFunOnKeyRemoved )(const SAutoRefPtr< IGradient > &obj) |
SMap< SStringW, SAutoRefPtr< IGradient > > * | m_mapNamedObj |
![]() | |
LONG | m_cRef |
Reference count. | |
Manages the mapping of gradient names to IGradient objects.
This class provides functionality to store and retrieve gradient objects by their names. It inherits from SCmnMap
to manage the mapping and from TObjRefImpl<IObjRef>
to handle reference counting.
Definition at line 27 of file SGradientPool.h.
SNSBEGIN IGradient * SGradientPool::GetGradient | ( | const SStringW & | strName | ) |
Retrieves the gradient object by its name.
strName | Name of the gradient. |
Definition at line 9 of file SGradientPool.cpp.
BOOL SGradientPool::Init | ( | SXmlNode | xmlNode | ) |
Initializes the gradient pool from an XML node.
xmlNode | XML node containing the gradient definitions. |
Definition at line 17 of file SGradientPool.cpp.