soui 5.0.0.1
Soui5 Doc
 
Loading...
Searching...
No Matches
SGradientPool Class Reference

Manages the mapping of gradient names to IGradient objects. More...

#include <SGradientPool.h>

Inheritance diagram for SGradientPool:
SCmnMap< SAutoRefPtr< IGradient >, SStringW > TObjRefImpl< IObjRef > IObjRef

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.
 
- Public Member Functions inherited from SCmnMap< SAutoRefPtr< IGradient >, SStringW >
 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.
 
- Public Member Functions inherited from TObjRefImpl< IObjRef >
 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.
 
- Public Member Functions inherited from IObjRef
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

- Protected Attributes inherited from SCmnMap< SAutoRefPtr< IGradient >, SStringW >
void(* m_pFunOnKeyRemoved )(const SAutoRefPtr< IGradient > &obj)
 
SMap< SStringW, SAutoRefPtr< IGradient > > * m_mapNamedObj
 
- Protected Attributes inherited from TObjRefImpl< IObjRef >
LONG m_cRef
 Reference count.
 

Detailed Description

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.

Member Function Documentation

◆ GetGradient()

SNSBEGIN IGradient * SGradientPool::GetGradient ( const SStringW & strName)

Retrieves the gradient object by its name.

Parameters
strNameName of the gradient.
Returns
Pointer to the IGradient object, or nullptr if not found.

Definition at line 9 of file SGradientPool.cpp.

◆ Init()

BOOL SGradientPool::Init ( SXmlNode xmlNode)

Initializes the gradient pool from an XML node.

Parameters
xmlNodeXML node containing the gradient definitions.
Returns
TRUE if initialization is successful, FALSE otherwise.

Definition at line 17 of file SGradientPool.cpp.


The documentation for this class was generated from the following files: