All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
rcg::Interface Class Reference

The interface class encapsulates a Genicam interface. More...

#include <interface.h>

Inheritance diagram for rcg::Interface:

Public Member Functions

void close ()
 Closes the interface. More...
 
std::shared_ptr< DevicegetDevice (const char *devid)
 
std::shared_ptr< DevicegetDevice (const char *devid, uint64_t timeout)
 Returns a device with the given device id. More...
 
std::vector< std::shared_ptr< Device > > getDevices ()
 
std::vector< std::shared_ptr< Device > > getDevices (uint64_t timeout)
 Returns the currently available devices on this interface. More...
 
std::string getDisplayName ()
 Returns the display name of the interface. More...
 
void * getHandle () const
 Get internal interace handle. More...
 
const std::string & getID () const
 Get the internal ID of this interface. More...
 
std::shared_ptr< GenApi::CNodeMapRefgetNodeMap ()
 Returns the node map of this object. More...
 
std::shared_ptr< SystemgetParent () const
 Returns the pointer to the parent system object. More...
 
std::string getTLType ()
 Returns the transport layer type of the interface. More...
 
 Interface (const std::shared_ptr< System > &parent, const std::shared_ptr< const GenTLWrapper > &gentl, const char *id)
 Constructs an interface class. More...
 
void open ()
 Opens the interface for working with it. More...
 
 ~Interface ()
 

Private Member Functions

 Interface (class Interface &)
 
Interfaceoperator= (const Interface &)
 

Private Attributes

std::shared_ptr< CPortcport
 
std::vector< std::weak_ptr< Device > > dlist
 
std::shared_ptr< const GenTLWrappergentl
 
std::string id
 
void * ifh
 
std::mutex mtx
 
int n_open
 
std::shared_ptr< GenApi::CNodeMapRefnodemap
 
std::shared_ptr< Systemparent
 

Detailed Description

The interface class encapsulates a Genicam interface.

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

Definition at line 54 of file interface.h.

Constructor & Destructor Documentation

◆ Interface() [1/2]

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

Constructs an interface class.

Interfaces must only be created by the system class.

Definition at line 48 of file interface.cc.

◆ ~Interface()

rcg::Interface::~Interface ( )

Definition at line 59 of file interface.cc.

◆ Interface() [2/2]

rcg::Interface::Interface ( class Interface )
private

Member Function Documentation

◆ close()

void rcg::Interface::close ( )

Closes the interface.

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

Definition at line 100 of file interface.cc.

◆ getDevice() [1/2]

std::shared_ptr< Device > rcg::Interface::getDevice ( const char *  devid)

Definition at line 289 of file interface.cc.

◆ getDevice() [2/2]

std::shared_ptr< Device > rcg::Interface::getDevice ( const char *  devid,
uint64_t  timeout 
)

Returns a device with the given device id.

NOTE: open() must be called before calling this method.

Parameters
devidDevice ID.
timeoutTimeout in ms for discovery of devices. The method without this parameter uses a timeout of 1000 ms.
Returns
Pointer to device or std::nullptr.

Definition at line 236 of file interface.cc.

◆ getDevices() [1/2]

std::vector< std::shared_ptr< Device > > rcg::Interface::getDevices ( )

Definition at line 231 of file interface.cc.

◆ getDevices() [2/2]

std::vector< std::shared_ptr< Device > > rcg::Interface::getDevices ( uint64_t  timeout)

Returns the currently available devices on this interface.

NOTE: open() must be called before calling this method.

Parameters
timeoutTimeout in ms for discovery of devices. The method without this parameter uses a timeout of 1000 ms.
Returns
List of devices.

Definition at line 139 of file interface.cc.

◆ getDisplayName()

std::string rcg::Interface::getDisplayName ( )

Returns the display name of the interface.

NOTE: At least the parent object must have been opened before calling this method.

Returns
Display name.

Definition at line 331 of file interface.cc.

◆ getHandle()

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

Get internal interace handle.

Returns
Internal handle.

Definition at line 355 of file interface.cc.

◆ getID()

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

Get the internal ID of this interface.

Returns
ID.

Definition at line 73 of file interface.cc.

◆ getNodeMap()

std::shared_ptr< GenApi::CNodeMapRef > rcg::Interface::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 343 of file interface.cc.

◆ getParent()

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

Returns the pointer to the parent system object.

Returns
Pointer to parent system object.

Definition at line 68 of file interface.cc.

◆ getTLType()

std::string rcg::Interface::getTLType ( )

Returns the transport layer type of the interface.

NOTE: At least the parent object must have been opened before calling this method.

Returns
Transport layer type.

Definition at line 337 of file interface.cc.

◆ open()

void rcg::Interface::open ( )

Opens the interface 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 78 of file interface.cc.

◆ operator=()

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

Member Data Documentation

◆ cport

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

Definition at line 180 of file interface.h.

◆ dlist

std::vector<std::weak_ptr<Device> > rcg::Interface::dlist
private

Definition at line 183 of file interface.h.

◆ gentl

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

Definition at line 172 of file interface.h.

◆ id

std::string rcg::Interface::id
private

Definition at line 173 of file interface.h.

◆ ifh

void* rcg::Interface::ifh
private

Definition at line 178 of file interface.h.

◆ mtx

std::mutex rcg::Interface::mtx
private

Definition at line 175 of file interface.h.

◆ n_open

int rcg::Interface::n_open
private

Definition at line 177 of file interface.h.

◆ nodemap

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

Definition at line 181 of file interface.h.

◆ parent

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

Definition at line 171 of file interface.h.


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


rc_genicam_api
Author(s): Heiko Hirschmueller
autogenerated on Wed Dec 4 2024 03:10:13