ModelResource< T > Class Template Reference

This is a Resource class that wraps an object from ModelServices. More...

#include <ObjectResource.h>

Inheritance diagram for ModelResource< T >:

Inheritance graph

List of all members.

Public Member Functions

 ModelResource (std::string name, DataElement *pParent=NULL, std::string type=std::string())
 ModelResource (DataDescriptor *pDescriptor)
 ModelResource (T *pElement)


Detailed Description

template<class T>
class ModelResource< T >

This is a Resource class that wraps an object from ModelServices.

This is a Resource class that wraps an object from ModelServices. When the ModelResource object goes out of scope, the object will be returned to ModelServices.

  void addPixels(AoiElement *pAoi)
  {
     ModelResource<AoiElement> pAoi2("MyAoi");
     for (int i=0; i<100; ++i)
        for (int j=0; j<100; ++j)
           if ((i^j) & 0x1) pAoi2->addPoint (i, j);
     pAoi->merge (pAoi2.get ());
  } // AOI returned to ModelServices here

See also:
ModelServices
Examples:

Tutorial/Tutorial5.cpp.

Definition at line 223 of file ObjectResource.h.


Constructor & Destructor Documentation

template<class T>
ModelResource< T >::ModelResource ( std::string  name,
DataElement pParent = NULL,
std::string  type = std::string() 
) [explicit]

Definition at line 226 of file ObjectResource.h.

template<class T>
ModelResource< T >::ModelResource ( DataDescriptor pDescriptor  )  [explicit]

Create a ModelResource for the given descriptor.

Parameters:
pDescriptor The DataDescriptor which describes the desired DataElement. ModelResource takes ownership of this object. It is not safe to dereference pDescriptor after creating the ModelResource.

Definition at line 240 of file ObjectResource.h.

template<class T>
ModelResource< T >::ModelResource ( T *  pElement  )  [explicit]

Create a ModelResource which owns the provided element and will destroy it when the resource is destroyed.

Parameters:
pElement the element that will be owned by this resource.

Definition at line 251 of file ObjectResource.h.


Software Development Kit - Opticks 4.9.0 Build 16218