solarpowerlog trunk
CCapability Class Reference

#include <CCapability.h>

Inheritance diagram for CCapability:
Collaboration diagram for CCapability:

List of all members.

Public Member Functions

 CCapability (const string &descr, IValue *val, IInverterBase *datasrc=NULL)
 CCapability (const string &descr, IValue::factory_types type, IInverterBase *datasrc=NULL)
virtual ~CCapability ()
const string & getDescription () const
virtual IInverterBasegetSource () const
virtual IValuegetValue () const

Protected Attributes

string description
IInverterBasesource
IValuevalue

Detailed Description

Implements the CCapability Concept

Please see the Capability Concept description for details on the concepts.

The class is noncopyable as usually a Capability is non-transferable due to the assosicated Value.

OBJECTS ASSESTS (OBJECT OWNERSHIPS)

To understand object responsibility (espcially who's task it is to delete that object) , and as the class contains some pointers to foreign objects, it is important to define the responsbility on these objects.

  • source NOT RESPONSIBLE
  • value TAKES OWNERSHIP. DELETES ON DESTRUCTION.

Definition at line 148 of file CCapability.h.


Constructor & Destructor Documentation

CCapability::CCapability ( const string &  descr,
IValue val,
IInverterBase datasrc = NULL 
)

Construct a Capability, specify the concrete objects it should use.

Parameters:
descrString used to identify the Capabilty. Should be descriptive,as it might be present to the end-user.
valAssociated Value object.
datasrcPointer to the generating Inverter. Can be used for datafilter to find out what the origin of the data is.

Definition at line 44 of file CCapability.cpp.

CCapability::CCapability ( const string &  descr,
IValue::factory_types  type,
IInverterBase datasrc = NULL 
)

Convenience-Constructor: Make a Capabilty and also create the value-object.

Definition at line 52 of file CCapability.cpp.

Here is the call graph for this function:

CCapability::~CCapability ( ) [virtual]

Destructor. Deletes the value object as well. (See CCapability for details)

Definition at line 60 of file CCapability.cpp.


Member Function Documentation

const string& CCapability::getDescription ( ) const [inline]

Get Access to the description

Returns:
description.

Definition at line 176 of file CCapability.h.

virtual IInverterBase* CCapability::getSource ( ) const [inline, virtual]

Get a the pointer to the one feeding this data.

Returns:
Pointer.
Warning:
may return NULL

Definition at line 186 of file CCapability.h.

virtual IValue* CCapability::getValue ( ) const [inline, virtual]

Returns the pointer t

Definition at line 192 of file CCapability.h.


Member Data Documentation

string CCapability::description [protected]

storage for the description passed by the creator

Definition at line 199 of file CCapability.h.

storage for the source-pointer passed by the creator

Definition at line 201 of file CCapability.h.

IValue* CCapability::value [protected]

storage for the value-pointer passed by the creator

Definition at line 203 of file CCapability.h.


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