soui 5.0.0.1
Soui5 Doc
 
Loading...
Searching...
No Matches
SObjectImpl< T > Class Template Reference

Template class for implementing the SObject interface. More...

#include <Sobject.hpp>

Public Member Functions

 SObjectImpl ()
 Constructor.
 
BOOL InitFromXml (IXmlNode *pXmlNode) OVERRIDE
 Initializes the object from an XML node.
 
LPCWSTR GetName () SCONST OVERRIDE
 Retrieves the object's name.
 
LPCSTR GetNameA () SCONST OVERRIDE
 Retrieves the object's name in ANSI format.
 
void SetName (LPCWSTR pszName) OVERRIDE
 Sets the object's name.
 
int GetID () SCONST OVERRIDE
 Retrieves the object's ID.
 
void SetID (int nID) OVERRIDE
 Sets the object's ID.
 
HRESULT AfterAttribute (LPCWSTR strAttribName, LPCWSTR strValue, BOOL bLoading, HRESULT hr) OVERRIDE
 Handles attribute processing after setting an attribute.
 
HRESULT SetAttributeA (LPCSTR pszAttr, LPCSTR pszValue, BOOL bLoading) OVERRIDE
 Sets an attribute using ANSI strings.
 
HRESULT SetAttribute (LPCWSTR pszAttr, LPCWSTR pszValue, BOOL bLoading) OVERRIDE
 Sets an attribute using wide strings.
 
HRESULT ISetAttribute (const IStringW *strAttr, const IStringW *strValue, BOOL bLoading) OVERRIDE
 Sets an attribute using IStringW objects.
 
LPCWSTR GetObjectClass () SCONST OVERRIDE
 Retrieves the object's class name.
 
int GetObjectType () SCONST OVERRIDE
 Retrieves the object's type.
 
BOOL IsClass (LPCWSTR lpszName) SCONST OVERRIDE
 Checks if the object is of a specific class.
 
BOOL GetAttribute (LPCWSTR strAttr, IStringW *pValue) SCONST OVERRIDE
 Retrieves an attribute value.
 
void OnInitFinished (IXmlNode *xmlNode) OVERRIDE
 Handles initialization completion.
 
void SetAttrHandler (FunAttrHandler attrHandler) OVERRIDE
 Sets the attribute handler.
 
virtual HRESULT SetAttribute (const SStringW &strAttr, const SStringW &strValue, BOOL bLoading)
 Sets an attribute using wide strings.
 
virtual HRESULT DefAttributeProc (const SStringW &strAttr, const SStringW &strValue, BOOL bLoading)
 Default attribute processing.
 

Static Public Member Functions

static int GetClassType ()
 Retrieves the class type.
 
static LPCWSTR GetClassName ()
 Retrieves the class name.
 
static LPCWSTR GetClassAlias ()
 Retrieves the class alias.
 
static void MarkAttributeHandled (SXmlAttr xmlAttr, bool bHandled)
 Marks an attribute as handled.
 
static bool IsAttributeHandled (SXmlAttr xmlAttr)
 Checks if an attribute is handled.
 

Protected Attributes

SStringW m_strName
 
int m_nID
 
FunAttrHandler m_attrHandler
 

Detailed Description

template<class T>
class SObjectImpl< T >

Template class for implementing the SObject interface.

This class provides runtime type identification and attribute dispatching based on XML descriptions.

Template Parameters
TBase class that implements the IObject interface.

Definition at line 26 of file Sobject.hpp.

Constructor & Destructor Documentation

◆ SObjectImpl()

template<class T>
SObjectImpl< T >::SObjectImpl ( )
inline

Constructor.

Definition at line 75 of file Sobject.hpp.

Member Function Documentation

◆ AfterAttribute()

template<class T>
HRESULT SObjectImpl< T >::AfterAttribute ( LPCWSTR strAttribName,
LPCWSTR strValue,
BOOL bLoading,
HRESULT hr )
inline

Handles attribute processing after setting an attribute.

Parameters
strAttribNameAttribute name.
strValueAttribute value.
bLoadingTRUE if the object is being loaded, FALSE otherwise.
hrResult of the attribute setting.
Returns
Result of the attribute processing.

Definition at line 154 of file Sobject.hpp.

◆ DefAttributeProc()

template<class T>
virtual HRESULT SObjectImpl< T >::DefAttributeProc ( const SStringW & strAttr,
const SStringW & strValue,
BOOL bLoading )
inlinevirtual

Default attribute processing.

Parameters
strAttrAttribute name.
strValueAttribute value.
bLoadingTRUE if the object is being loaded, FALSE otherwise.
Returns
Result of default attribute processing.

Reimplemented in SWindow.

Definition at line 279 of file Sobject.hpp.

◆ GetAttribute()

template<class T>
BOOL SObjectImpl< T >::GetAttribute ( LPCWSTR strAttr,
IStringW * pValue )
inline

Retrieves an attribute value.

Parameters
strAttrAttribute name.
pValuePointer to store the attribute value.
Returns
TRUE if the attribute is retrieved successfully, FALSE otherwise.

Definition at line 238 of file Sobject.hpp.

◆ GetClassAlias()

template<class T>
static LPCWSTR SObjectImpl< T >::GetClassAlias ( )
inlinestatic

Retrieves the class alias.

Returns
Class alias as a wide string.

Definition at line 49 of file Sobject.hpp.

◆ GetClassName()

template<class T>
static LPCWSTR SObjectImpl< T >::GetClassName ( )
inlinestatic

Retrieves the class name.

Returns
Class name as a wide string.

Definition at line 41 of file Sobject.hpp.

◆ GetClassType()

template<class T>
static int SObjectImpl< T >::GetClassType ( )
inlinestatic

Retrieves the class type.

Returns
Class type identifier.

Definition at line 33 of file Sobject.hpp.

◆ GetID()

template<class T>
int SObjectImpl< T >::GetID ( )
inline

Retrieves the object's ID.

Returns
Object's ID.

Definition at line 134 of file Sobject.hpp.

◆ GetName()

template<class T>
LPCWSTR SObjectImpl< T >::GetName ( )
inline

Retrieves the object's name.

Returns
Object's name as a wide string.

Definition at line 108 of file Sobject.hpp.

◆ GetNameA()

template<class T>
LPCSTR SObjectImpl< T >::GetNameA ( )
inline

Retrieves the object's name in ANSI format.

Returns
Object's name as an ANSI string.

Definition at line 116 of file Sobject.hpp.

◆ GetObjectClass()

template<class T>
LPCWSTR SObjectImpl< T >::GetObjectClass ( )
inline

Retrieves the object's class name.

Returns
Class name as a wide string.

Definition at line 211 of file Sobject.hpp.

◆ GetObjectType()

template<class T>
int SObjectImpl< T >::GetObjectType ( )
inline

Retrieves the object's type.

Returns
Object type identifier.

Definition at line 219 of file Sobject.hpp.

◆ InitFromXml()

template<class T>
BOOL SObjectImpl< T >::InitFromXml ( IXmlNode * pXmlNode)
inline

Initializes the object from an XML node.

Parameters
pXmlNodePointer to the XML node containing the object's attributes.
Returns
TRUE if initialization is successful, FALSE otherwise.

Definition at line 83 of file Sobject.hpp.

◆ IsAttributeHandled()

template<class T>
static bool SObjectImpl< T >::IsAttributeHandled ( SXmlAttr xmlAttr)
inlinestatic

Checks if an attribute is handled.

Parameters
xmlAttrXML attribute to check.
Returns
TRUE if the attribute is handled, FALSE otherwise.

Definition at line 68 of file Sobject.hpp.

◆ IsClass()

template<class T>
BOOL SObjectImpl< T >::IsClass ( LPCWSTR lpszName)
inline

Checks if the object is of a specific class.

Parameters
lpszNameClass name to check.
Returns
TRUE if the object is of the specified class, FALSE otherwise.

Definition at line 228 of file Sobject.hpp.

◆ ISetAttribute()

template<class T>
HRESULT SObjectImpl< T >::ISetAttribute ( const IStringW * strAttr,
const IStringW * strValue,
BOOL bLoading )
inline

Sets an attribute using IStringW objects.

Parameters
strAttrAttribute name.
strValueAttribute value.
bLoadingTRUE if the object is being loaded, FALSE otherwise.
Returns
Result of setting the attribute.

Definition at line 197 of file Sobject.hpp.

◆ MarkAttributeHandled()

template<class T>
static void SObjectImpl< T >::MarkAttributeHandled ( SXmlAttr xmlAttr,
bool bHandled )
inlinestatic

Marks an attribute as handled.

Parameters
xmlAttrXML attribute to mark.
bHandledTRUE if the attribute is handled, FALSE otherwise.

Definition at line 59 of file Sobject.hpp.

◆ OnInitFinished()

template<class T>
void SObjectImpl< T >::OnInitFinished ( IXmlNode * xmlNode)
inline

Handles initialization completion.

Parameters
xmlNodeXML node containing the object's attributes.

Definition at line 248 of file Sobject.hpp.

◆ SetAttrHandler()

template<class T>
void SObjectImpl< T >::SetAttrHandler ( FunAttrHandler attrHandler)
inline

Sets the attribute handler.

Parameters
attrHandlerFunction pointer to the attribute handler.

Definition at line 256 of file Sobject.hpp.

◆ SetAttribute() [1/2]

template<class T>
virtual HRESULT SObjectImpl< T >::SetAttribute ( const SStringW & strAttr,
const SStringW & strValue,
BOOL bLoading )
inlinevirtual

Sets an attribute using wide strings.

Parameters
strAttrAttribute name.
strValueAttribute value.
bLoadingTRUE if the object is being loaded, FALSE otherwise.
Returns
Result of setting the attribute.

Definition at line 268 of file Sobject.hpp.

◆ SetAttribute() [2/2]

template<class T>
HRESULT SObjectImpl< T >::SetAttribute ( LPCWSTR pszAttr,
LPCWSTR pszValue,
BOOL bLoading )
inline

Sets an attribute using wide strings.

Parameters
pszAttrAttribute name.
pszValueAttribute value.
bLoadingTRUE if the object is being loaded, FALSE otherwise.
Returns
Result of setting the attribute.

Definition at line 179 of file Sobject.hpp.

◆ SetAttributeA()

template<class T>
HRESULT SObjectImpl< T >::SetAttributeA ( LPCSTR pszAttr,
LPCSTR pszValue,
BOOL bLoading )
inline

Sets an attribute using ANSI strings.

Parameters
pszAttrAttribute name.
pszValueAttribute value.
bLoadingTRUE if the object is being loaded, FALSE otherwise.
Returns
Result of setting the attribute.

Definition at line 168 of file Sobject.hpp.

◆ SetID()

template<class T>
void SObjectImpl< T >::SetID ( int nID)
inline

Sets the object's ID.

Parameters
nIDID to set.

Definition at line 142 of file Sobject.hpp.

◆ SetName()

template<class T>
void SObjectImpl< T >::SetName ( LPCWSTR pszName)
inline

Sets the object's name.

Parameters
pszNameName to set.

Definition at line 126 of file Sobject.hpp.

Member Data Documentation

◆ m_attrHandler

template<class T>
FunAttrHandler SObjectImpl< T >::m_attrHandler
protected

Attribute handler function

Definition at line 296 of file Sobject.hpp.

◆ m_nID

template<class T>
int SObjectImpl< T >::m_nID
protected

Object's ID

Definition at line 294 of file Sobject.hpp.

◆ m_strName

template<class T>
SStringW SObjectImpl< T >::m_strName
protected

Object's name

Definition at line 293 of file Sobject.hpp.


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