My Project
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Private Attributes | List of all members
TemplateStructWeakRef Class Reference

Weak reference wrapper for TemplateStructIntf that provides access to the wrapped struct without holding a reference. More...

Inheritance diagram for TemplateStructWeakRef:
TemplateStructIntf

Public Member Functions

 TemplateStructWeakRef (TemplateStructIntf *ref)
 
virtual TemplateVariant get (const char *name) const
 
virtual int addRef ()
 
virtual int release ()
 
- Public Member Functions inherited from TemplateStructIntf
virtual ~TemplateStructIntf ()
 

Private Attributes

TemplateStructIntfm_ref
 
int m_refCount
 

Detailed Description

Weak reference wrapper for TemplateStructIntf that provides access to the wrapped struct without holding a reference.

Definition at line 2353 of file template.cpp.

Constructor & Destructor Documentation

TemplateStructWeakRef::TemplateStructWeakRef ( TemplateStructIntf ref)
inline

Definition at line 2356 of file template.cpp.

: m_ref(ref), m_refCount(0) {}

Member Function Documentation

virtual int TemplateStructWeakRef::addRef ( )
inlinevirtual

Increase object's reference count

Implements TemplateStructIntf.

Definition at line 2358 of file template.cpp.

References m_refCount.

{ return ++m_refCount; }
virtual TemplateVariant TemplateStructWeakRef::get ( const char *  name) const
inlinevirtual

Gets the value for a field name.

Parameters
[in]nameThe name of the field.

Implements TemplateStructIntf.

Definition at line 2357 of file template.cpp.

References TemplateStructIntf::get(), and m_ref.

{ return m_ref->get(name); }
virtual int TemplateStructWeakRef::release ( )
inlinevirtual

Decreases object's referenc count, destroy object if 0

Implements TemplateStructIntf.

Definition at line 2359 of file template.cpp.

References m_refCount.

{ int count=--m_refCount; if (count<=0) { delete this; } return count; }

Member Data Documentation

TemplateStructIntf* TemplateStructWeakRef::m_ref
private

Definition at line 2361 of file template.cpp.

Referenced by get().

int TemplateStructWeakRef::m_refCount
private

Definition at line 2362 of file template.cpp.

Referenced by addRef(), and release().


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