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

#include <Written.hpp>

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

Public Types

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

Public Member Functions

virtual WrittenSharedPtr newWrittenPtr (const TimeStamp &inTimeStamp, const StatusSharedPtr &inStatusPtr, const std::string &inAuthorName=std::string(), const std::string &inProgramName=std::string(), const std::string &inProgramVersion=std::string(), const std::string &inDataOriginLocName=std::string(), const std::string &inDataOriginVersion=std::string()) throw (Error)
 
virtual void create (Pointer &outPointer) throw (Error)
 

Detailed Description

Convenience class to create a written.

Definition at line 43 of file Written.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< Written >::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
WrittenSharedPtr torc::generic::Written::Factory::newWrittenPtr ( const TimeStamp inTimeStamp,
const StatusSharedPtr inStatusPtr,
const std::string &  inAuthorName = std::string(),
const std::string &  inProgramName = std::string(),
const std::string &  inProgramVersion = std::string(),
const std::string &  inDataOriginLocName = std::string(),
const std::string &  inDataOriginVersion = std::string() 
)
throw (Error
)
virtual

Create a written.

Parameters
[in]inTimeStampTimeStamp in Universal Time Coordinate.
[in]inStatusPtrPointer to parented(Status) object.
[in]inAuthorNameName of the author
[in]inProgramNameName of the program
[in]inProgramVersionVersion of the program
[in]inDataOriginLocNameData Origin Location Name
[in]inDataOriginVersionVersion of the DataOrigin
Returns
Pointer to created written.

Definition at line 35 of file Written.cpp.

38  {
39  try {
40  WrittenSharedPtr newWritten;
41  create(newWritten);
42  newWritten->setTimeStamp(inTimeStamp);
43  newWritten->setAuthorName(inAuthorName);
44  newWritten->setProgramName(inProgramName);
45  newWritten->setProgramVersion(inProgramVersion);
46  newWritten->setDataOriginLocationName(inDataOriginLocName);
47  newWritten->setDataOriginVersion(inDataOriginVersion);
48  if(inStatusPtr) {
49  inStatusPtr->addWritten(newWritten);
50  }
51  return newWritten;
52  } catch(Error& e) {
53  e.setCurrentLocation(__FUNCTION__, __FILE__, __LINE__);
54  throw;
55  }
56 }
virtual void create(Pointer &outPointer)
Definition: FactoryType.hpp:58
boost::shared_ptr< Written > WrittenSharedPtr

+ Here is the call graph for this function:


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