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

#include <ScalarPort.hpp>

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

Public Types

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

Public Member Functions

virtual ScalarPortSharedPtr newScalarPortPtr (const std::string &inName, const EPortDirection &inDirection, const ViewSharedPtr &inViewPtr, const PortBundleSharedPtr &inParentCollection=PortBundleSharedPtr(), const std::string &inOriginalName=std::string()) throw (Error)
 
virtual void create (Pointer &outPointer) throw (Error)
 

Detailed Description

Convenience class to create a scalar port.

Definition at line 54 of file ScalarPort.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< ScalarPort >::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
ScalarPortSharedPtr torc::generic::ScalarPort::Factory::newScalarPortPtr ( const std::string &  inName,
const EPortDirection inDirection,
const ViewSharedPtr inViewPtr,
const PortBundleSharedPtr inParentCollection = PortBundleSharedPtr(),
const std::string &  inOriginalName = std::string() 
)
throw (Error
)
virtual

Create a scalar port.

Parameters
[in]inNameName of the scalar port to be created.
[in]inDirectionDirection of port.
[in]inViewPtrPointer to parented(View) object.
[in]inParentCollectionPointer to parent bundle.
[in]inOriginalNameOriginal name of the scalar port [optional].
Returns
Pointer to created scalar port.

Create a scalar port.

Parameters
[in]inNameName of the scalar port to be created.
[in]inDirectionDirection of port.
[in]inViewPtrPointer to parented(View) object.
[in]inOriginalNameOriginal name of the scalar port [optional].
Returns
Pointer to created scalar port.

Definition at line 50 of file ScalarPort.cpp.

53  {
54  try {
55  ScalarPortSharedPtr newScalarPort;
56  create(newScalarPort);
57  newScalarPort->setName(inName);
58  newScalarPort->setDirection(inDirection);
59  newScalarPort->setOriginalName(inOriginalName);
60  if(inParentCollection) {
61  inParentCollection->addChild(newScalarPort);
62  } else {
63  inViewPtr->addPort(newScalarPort);
64  }
65  return newScalarPort;
66  } catch(Error& e) {
67  e.setCurrentLocation(__FUNCTION__, __FILE__, __LINE__);
68  throw;
69  }
70 }
boost::shared_ptr< ScalarPort > ScalarPortSharedPtr
virtual void create(Pointer &outPointer)
Definition: FactoryType.hpp:58

+ Here is the call graph for this function:


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