soui 5.0.0.1
Soui5 Doc
 
Loading...
Searching...
No Matches
SGradientPool.h
Go to the documentation of this file.
1/**
2 * @file SGradientPool.h
3 * @brief Gradient Pool Management
4 * @version v1.0
5 * @author SOUI团队
6 * @date 2014-05-28
7 *
8 * @details Manages a pool of gradients identified by names.
9 */
10
11#ifndef __SGRADIENTPOOL__H__
12#define __SGRADIENTPOOL__H__
13
14#include <core/SCmnMap.h>
15#include <interface/obj-ref-i.h>
16#include <helper/obj-ref-impl.hpp>
17
18SNSBEGIN
19
20/**
21 * @class SGradientPool
22 * @brief Manages the mapping of gradient names to IGradient objects.
23 *
24 * @details This class provides functionality to store and retrieve gradient objects by their names.
25 * It inherits from `SCmnMap` to manage the mapping and from `TObjRefImpl<IObjRef>` to handle reference counting.
26 */
27class SOUI_EXP SGradientPool
28 : public SCmnMap<SAutoRefPtr<IGradient>, SStringW>
29 , public TObjRefImpl<IObjRef> {
30 public:
31 /**
32 * @brief Retrieves the gradient object by its name.
33 * @param strName Name of the gradient.
34 * @return Pointer to the IGradient object, or nullptr if not found.
35 */
36 IGradient *GetGradient(const SStringW &strName);
37
38 /**
39 * @brief Initializes the gradient pool from an XML node.
40 * @param xmlNode XML node containing the gradient definitions.
41 * @return TRUE if initialization is successful, FALSE otherwise.
42 */
43 BOOL Init(SXmlNode xmlNode);
44};
45
46SNSEND
47
48#endif // __SGRADIENTPOOL__H__
SCmnMap(void(*funOnKeyRemoved)(const SAutoRefPtr< IGradient > &)=NULL)
Definition SCmnMap.h:28
Manages the mapping of gradient names to IGradient objects.
BOOL Init(SXmlNode xmlNode)
Initializes the gradient pool from an XML node.
IGradient * GetGradient(const SStringW &strName)
Retrieves the gradient object by its name.
A class representing an ASCII string.
Definition sstringw.h:96
Class representing an XML node.
Definition SXml.h:352