torc-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
torc::generic::Property::Factory Class Reference

#include <Property.hpp>

+ Inheritance diagram for torc::generic::Property::Factory:
+ Collaboration diagram for torc::generic::Property::Factory:

Public Types

typedef Property Type
 
typedef SelfReferencing< Type >
::Pointer 
Pointer
 
typedef SelfReferencing< Type >
::WeakPointer 
WeakPointer
 

Public Member Functions

virtual PropertySharedPtr newPropertyPtr (const std::string &inName, const PropertyContainerSharedPtr &inContainer, const Value &inValue, const Unit &inUnit=eUnitUndefined, const PropertySharedPtr &inParentProperty=PropertySharedPtr(), const std::string &inOriginalName=std::string()) throw (Error)
 
virtual void create (Pointer &outPointer) throw (Error)
 

Detailed Description

Convenience class to create a property.

Definition at line 63 of file Property.hpp.

Member Typedef Documentation

A pointer to an object of type Type

Definition at line 45 of file FactoryType.hpp.

A rename of the parameter type

Definition at line 40 of file FactoryType.hpp.

A weak pointer to an object of type Type

Definition at line 50 of file FactoryType.hpp.

Member Function Documentation

virtual void torc::generic::FactoryType< Property >::create ( Pointer outPointer)
throw (Error
)
inlinevirtualinherited

Create an object of the Type specification of Factory. If the object has a boost::weak_ptr to itself, it is the task of this method to set this after the object is created.

Returns
A pointer to the freshly created object.

Definition at line 58 of file FactoryType.hpp.

58  {
59  try {
60  Pointer temp(new _Tp()); //Do not remove
61  outPointer = temp;
62  WeakPointer weakPtr(outPointer);
63  outPointer->setWeakThis(weakPtr);
64  } catch(std::exception& e) //May receive std::bad_alloc
65  {
66  //TBD::ERROR
67  }
68  }
SelfReferencing< Type >::WeakPointer WeakPointer
Definition: FactoryType.hpp:50
SelfReferencing< Type >::Pointer Pointer
Definition: FactoryType.hpp:45
PropertySharedPtr torc::generic::Property::Factory::newPropertyPtr ( const std::string &  inName,
const PropertyContainerSharedPtr inContainer,
const Value inValue,
const Unit inUnit = eUnitUndefined,
const PropertySharedPtr inParentProperty = PropertySharedPtr(),
const std::string &  inOriginalName = std::string() 
)
throw (Error
)
inlinevirtual

Create a property.

Parameters
[in]inNameName of the property to be created.
[in]inContainerPointer of the property container.
[in]inValueValue of the property.
[in]inUnitUnit of the property.
Returns
Pointer to created property.

Definition at line 228 of file Property.hpp.

230  {
231  try {
232  PropertySharedPtr newProperty;
233  create(newProperty);
234  newProperty->setName(inName);
235  newProperty->setValue(inValue);
236  newProperty->setUnit(inUnit);
237  newProperty->setOriginalName(inOriginalName);
238  if(inParentProperty) {
239  inParentProperty->addChildProperty(inName, newProperty);
240  } else {
241  inContainer->setProperty(inName, newProperty);
242  }
243  return newProperty;
244  } catch(Error& e) {
245  e.setCurrentLocation(__FUNCTION__, __FILE__, __LINE__);
246  throw;
247  }
248 }
virtual void create(Pointer &outPointer)
Definition: FactoryType.hpp:58
boost::shared_ptr< Property > PropertySharedPtr

+ Here is the call graph for this function:


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