Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
rcg::Device Class Reference

The device class encapsulates a Genicam device. More...

#include <device.h>

Inheritance diagram for rcg::Device:
Inheritance graph
[legend]

Public Types

enum  ACCESS { READONLY, CONTROL, EXCLUSIVE }
 

Public Member Functions

void close ()
 Closes the device. More...
 
 Device (const std::shared_ptr< Interface > &parent, const std::shared_ptr< const GenTLWrapper > &gentl, const char *id)
 Constructs a device class. More...
 
std::string getAccessStatus ()
 Returns the access status of the device. More...
 
std::string getDisplayName ()
 Returns the display name of the device. More...
 
void * getHandle () const
 Get internal interface handle. More...
 
const std::string & getID () const
 Get the internal ID of this device. More...
 
std::string getModel ()
 Returns the model of the device. More...
 
std::shared_ptr< GenApi::CNodeMapRefgetNodeMap ()
 Returns the node map of this object. More...
 
std::shared_ptr< InterfacegetParent () const
 Returns the pointer to the parent interface object. More...
 
std::shared_ptr< GenApi::CNodeMapRefgetRemoteNodeMap (const char *xml=0)
 Returns the node map of the remote device. More...
 
std::string getSerialNumber ()
 Returns the serial number of the device. More...
 
std::vector< std::shared_ptr< Stream > > getStreams ()
 Returns the currently available streams of this device. More...
 
uint64_t getTimestampFrequency ()
 Returns the timestamp frequency of the device. More...
 
std::string getTLType ()
 Returns the transport layer type of the device. More...
 
std::string getUserDefinedName ()
 Returns the user defined name of the device. More...
 
std::string getVendor ()
 Returns the vendor of the device. More...
 
std::string getVersion ()
 Returns the version of the device. More...
 
void open (ACCESS access)
 Opens the device for working with it. More...
 
 ~Device ()
 

Private Member Functions

 Device (class Device &)
 
Deviceoperator= (const Device &)
 

Private Attributes

std::shared_ptr< CPortcport
 
void * dev
 
std::shared_ptr< const GenTLWrappergentl
 
std::string id
 
std::mutex mtx
 
int n_open
 
std::shared_ptr< GenApi::CNodeMapRefnodemap
 
std::shared_ptr< Interfaceparent
 
std::shared_ptr< GenApi::CNodeMapRefrnodemap
 
void * rp
 
std::shared_ptr< CPortrport
 
std::vector< std::weak_ptr< Stream > > slist
 

Detailed Description

The device class encapsulates a Genicam device.

NOTE: A GenTLException is thrown in case of a severe error.

Definition at line 54 of file device.h.

Member Enumeration Documentation

Enumerator
READONLY 
CONTROL 
EXCLUSIVE 

Definition at line 58 of file device.h.

Constructor & Destructor Documentation

rcg::Device::Device ( const std::shared_ptr< Interface > &  parent,
const std::shared_ptr< const GenTLWrapper > &  gentl,
const char *  id 
)

Constructs a device class.

Devices must only be created by the interface class.

Definition at line 48 of file device.cc.

rcg::Device::~Device ( )

Definition at line 60 of file device.cc.

rcg::Device::Device ( class Device )
private

Member Function Documentation

void rcg::Device::close ( )

Closes the device.

Each call of open() must be followed by a call to close() at some point in time.

Definition at line 137 of file device.cc.

std::string rcg::Device::getAccessStatus ( )

Returns the access status of the device.

NOTE: This method only returns a non empty string if the parent interface has NOT been closed after Interface::getDevice() or Interface::getDevices() call, or if this device itself has been opened with the open() call.

Returns
Access status.

Definition at line 305 of file device.cc.

std::string rcg::Device::getDisplayName ( )

Returns the display name of the device.

NOTE: This method only returns a non empty string if the parent interface has NOT been closed after Interface::getDevice() or Interface::getDevices() call, or if this device itself has been opened with the open() call.

Returns
Display name.

Definition at line 299 of file device.cc.

void * rcg::Device::getHandle ( ) const

Get internal interface handle.

Returns
Internal handle.

Definition at line 432 of file device.cc.

const std::string & rcg::Device::getID ( ) const

Get the internal ID of this device.

Returns
ID.

Definition at line 80 of file device.cc.

std::string rcg::Device::getModel ( )

Returns the model of the device.

NOTE: This method only returns a non empty string if the parent interface has NOT been closed after Interface::getDevice() or Interface::getDevices() call, or if this device itself has been opened with the open() call.

Returns
Model.

Definition at line 287 of file device.cc.

std::shared_ptr< GenApi::CNodeMapRef > rcg::Device::getNodeMap ( )

Returns the node map of this object.

NOTE: open() must be called before calling this method. The returned pointer remains valid until close() of this object is called.

Returns
Node map of this object.

Definition at line 403 of file device.cc.

std::shared_ptr< Interface > rcg::Device::getParent ( ) const

Returns the pointer to the parent interface object.

Returns
Pointer to parent interface object.

Definition at line 75 of file device.cc.

std::shared_ptr< GenApi::CNodeMapRef > rcg::Device::getRemoteNodeMap ( const char *  xml = 0)

Returns the node map of the remote device.

NOTE: open() must be called before calling this method. The returned pointer remains valid until close() of this object is called.

Parameters
xmlPath and name for storing the received XML file or 0 if xml file should not be stored.
Returns
Node map of this object.

Definition at line 416 of file device.cc.

std::string rcg::Device::getSerialNumber ( )

Returns the serial number of the device.

NOTE: This method only returns a non empty string if the parent interface has NOT been closed after Interface::getDevice() or Interface::getDevices() call, or if this device itself has been opened with the open() call.

Returns
Serial number.

Definition at line 371 of file device.cc.

std::vector< std::shared_ptr< Stream > > rcg::Device::getStreams ( )

Returns the currently available streams of this device.

NOTE: The device must have been opened with the open() call before calling this method.

Returns
List of streams.

Definition at line 180 of file device.cc.

uint64_t rcg::Device::getTimestampFrequency ( )

Returns the timestamp frequency of the device.

NOTE: This method only returns a non empty string if the parent interface has NOT been closed after Interface::getDevice() or Interface::getDevices() call, or if this device itself has been opened with the open() call.

Returns
Tick-frequency of the time stamp clock.

Definition at line 383 of file device.cc.

std::string rcg::Device::getTLType ( )

Returns the transport layer type of the device.

NOTE: This method only returns a non empty string if the parent interface has NOT been closed after Interface::getDevice() or Interface::getDevices() call, or if this device itself has been opened with the open() call.

Returns
Transport layer type.

Definition at line 293 of file device.cc.

std::string rcg::Device::getUserDefinedName ( )

Returns the user defined name of the device.

NOTE: This method only returns a non empty string if the parent interface has NOT been closed after Interface::getDevice() or Interface::getDevices() call, or if this device itself has been opened with the open() call.

Returns
User defined name.

Definition at line 365 of file device.cc.

std::string rcg::Device::getVendor ( )

Returns the vendor of the device.

NOTE: This method only returns a non empty string if the parent interface has NOT been closed after Interface::getDevice() or Interface::getDevices() call, or if this device itself has been opened with the open() call.

Returns
Vendor.

Definition at line 281 of file device.cc.

std::string rcg::Device::getVersion ( )

Returns the version of the device.

NOTE: This method only returns a non empty string if the parent interface has NOT been closed after Interface::getDevice() or Interface::getDevices() call, or if this device itself has been opened with the open() call.

Returns
Version.

Definition at line 377 of file device.cc.

void rcg::Device::open ( ACCESS  access)

Opens the device for working with it.

The interface may be opened multiple times. However, for each open(), the close() method must be called as well.

Definition at line 85 of file device.cc.

Device& rcg::Device::operator= ( const Device )
private

Member Data Documentation

std::shared_ptr<CPort> rcg::Device::cport
private

Definition at line 266 of file device.h.

void* rcg::Device::dev
private

Definition at line 263 of file device.h.

std::shared_ptr<const GenTLWrapper> rcg::Device::gentl
private

Definition at line 257 of file device.h.

std::string rcg::Device::id
private

Definition at line 258 of file device.h.

std::mutex rcg::Device::mtx
private

Definition at line 260 of file device.h.

int rcg::Device::n_open
private

Definition at line 262 of file device.h.

std::shared_ptr<GenApi::CNodeMapRef> rcg::Device::nodemap
private

Definition at line 267 of file device.h.

std::shared_ptr<Interface> rcg::Device::parent
private

Definition at line 256 of file device.h.

std::shared_ptr<GenApi::CNodeMapRef> rcg::Device::rnodemap
private

Definition at line 267 of file device.h.

void* rcg::Device::rp
private

Definition at line 264 of file device.h.

std::shared_ptr<CPort> rcg::Device::rport
private

Definition at line 266 of file device.h.

std::vector<std::weak_ptr<Stream> > rcg::Device::slist
private

Definition at line 269 of file device.h.


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


rc_genicam_api
Author(s): Heiko Hirschmueller
autogenerated on Thu Jun 6 2019 19:10:56