IDS peak genericC++ v1.17.0
Loading...
Searching...
No Matches
peak::core::Port Class Reference

Represents a GenTL port. More...

#include <peak/port/peak_port.hpp>

Inheritance diagram for peak::core::Port:

Public Member Functions

 Port ()=delete
 ~Port ()=default
 Port (const class Port &other)=delete
Port & operator= (const class Port &other)=delete
 Port (class Port &&other)=delete
Port & operator= (class Port &&other)=delete
PEAK_COMMON_NO_DISCARD RawInformation Info (int32_t infoCommand) const
 Delivers information based on the given GenTL info command.
PEAK_COMMON_NO_DISCARD std::string ID () const
 Returns the ID.
PEAK_COMMON_NO_DISCARD std::string Name () const
 Returns the name.
PEAK_COMMON_NO_DISCARD std::string VendorName () const
 Returns the vendor name.
PEAK_COMMON_NO_DISCARD std::string ModelName () const
 Returns the model name.
PEAK_COMMON_NO_DISCARD std::string Version () const
 Returns the version.
PEAK_COMMON_NO_DISCARD std::string TLType () const
 Returns the TL (transport layer) type.
PEAK_COMMON_NO_DISCARD std::string ModuleName () const
 Returns the module name.
PEAK_COMMON_NO_DISCARD Endianness DataEndianness () const
 Returns the data endianness.
PEAK_COMMON_NO_DISCARD bool IsReadable () const
 Checks whether the port is readable.
PEAK_COMMON_NO_DISCARD bool IsWritable () const
 Checks whether the port is writable.
PEAK_COMMON_NO_DISCARD bool IsAvailable () const
 Checks whether the port is available.
PEAK_COMMON_NO_DISCARD bool IsImplemented () const
 Checks whether the port is implemented.
PEAK_COMMON_NO_DISCARD std::vector< uint8_t > Read (uint64_t address, size_t numBytes) const
 Reads a given amount of bytes at a given address.
void Write (uint64_t address, const std::vector< uint8_t > &bytes) const
 Writes a given amount of bytes at a given address.
PEAK_COMMON_NO_DISCARD std::vector< std::shared_ptr< PortURL > > URLs () const
 Returns the URLs.

Friends

class ClassCreator< Port >

Detailed Description

Represents a GenTL port.

This class allows to query information about a GenTL port and to enumerate its URLs.

Constructor & Destructor Documentation

◆ Port() [1/3]

peak::core::Port::Port ( )
delete

◆ ~Port()

peak::core::Port::~Port ( )
default

◆ Port() [2/3]

peak::core::Port::Port ( const class Port & other)
delete

◆ Port() [3/3]

peak::core::Port::Port ( class Port && other)
delete

Member Function Documentation

◆ DataEndianness()

Endianness peak::core::Port::DataEndianness ( ) const
inline

Returns the data endianness.

Returns
Data endianness
Since
1.0
Exceptions
InternalErrorExceptionAn internal error has occurred.

◆ ID()

std::string peak::core::Port::ID ( ) const
inline

Returns the ID.

Returns
ID
Since
1.0
Exceptions
InternalErrorExceptionAn internal error has occurred.

◆ Info()

RawInformation peak::core::Port::Info ( int32_t infoCommand) const
inline

Delivers information based on the given GenTL info command.

Parameters
[in]infoCommandThe GenTL info command.

This function can be used to query information going beyond the predefined info functions, based on the GenTL info commands of the corresponding module.

Example (error handling is omitted):

auto info = object->Info(GenTL::XX_INFO_XX);
// Cast depending on the delivered data type
if (info.dataType == GenTL::INFO_DATATYPE_UINT64)
{
uint64_t uint64Var = *reinterpret_cast<const uint64_t*>(info.data.data());
// Do something with the information
}
else if (infoDataTypeVar == GenTL::INFO_DATATYPE_INT64)
{
...
}
...
Returns
Raw information according to the passed info command
Since
1.0
Exceptions
InternalErrorExceptionAn internal error has occurred.

◆ IsAvailable()

bool peak::core::Port::IsAvailable ( ) const
inline

Checks whether the port is available.

Returns
True, if the port is available.
False otherwise.
Since
1.0
Exceptions
InternalErrorExceptionAn internal error has occurred.

◆ IsImplemented()

bool peak::core::Port::IsImplemented ( ) const
inline

Checks whether the port is implemented.

Returns
True, if the port is implemented.
False otherwise.
Since
1.0
Exceptions
InternalErrorExceptionAn internal error has occurred.

◆ IsReadable()

bool peak::core::Port::IsReadable ( ) const
inline

Checks whether the port is readable.

Returns
True, if the port is readable
False otherwise.
Since
1.0
Exceptions
InternalErrorExceptionAn internal error has occurred.

◆ IsWritable()

bool peak::core::Port::IsWritable ( ) const
inline

Checks whether the port is writable.

Returns
True, if the port is writable.
False otherwise.
Since
1.0
Exceptions
InternalErrorExceptionAn internal error has occurred.

◆ ModelName()

std::string peak::core::Port::ModelName ( ) const
inline

Returns the model name.

Returns
Model name
Since
1.0
Exceptions
InternalErrorExceptionAn internal error has occurred.

◆ ModuleName()

std::string peak::core::Port::ModuleName ( ) const
inline

Returns the module name.

Returns
Module name
Since
1.0
Exceptions
InternalErrorExceptionAn internal error has occurred.

◆ Name()

std::string peak::core::Port::Name ( ) const
inline

Returns the name.

Returns
Name
Since
1.0
Exceptions
InternalErrorExceptionAn internal error has occurred.

◆ operator=() [1/2]

Port & peak::core::Port::operator= ( class Port && other)
delete

◆ operator=() [2/2]

Port & peak::core::Port::operator= ( const class Port & other)
delete

◆ Read()

std::vector< uint8_t > peak::core::Port::Read ( uint64_t address,
size_t numBytes ) const
inline

Reads a given amount of bytes at a given address.

Parameters
[in]addressThe address to read at.
[in]numBytesThe amount of bytes to read.
Returns
Read bytes
Since
1.0
Exceptions
InvalidAddressExceptionAddress is invalid
IOExceptionA communication error has occured, e.g. when the device is disconnected.
InternalErrorExceptionAn internal error has occurred.

◆ TLType()

std::string peak::core::Port::TLType ( ) const
inline

Returns the TL (transport layer) type.

Returns
TL type
Since
1.0
Exceptions
InternalErrorExceptionAn internal error has occurred.

◆ URLs()

std::vector< std::shared_ptr< PortURL > > peak::core::Port::URLs ( ) const
inline

Returns the URLs.

Returns
URLs
Since
1.0
Exceptions
IOExceptionA communication error has occured, e.g. when the device is disconnected.
InternalErrorExceptionAn internal error has occurred.

◆ VendorName()

std::string peak::core::Port::VendorName ( ) const
inline

Returns the vendor name.

Returns
Vendor name
Since
1.0
Exceptions
InternalErrorExceptionAn internal error has occurred.

◆ Version()

std::string peak::core::Port::Version ( ) const
inline

Returns the version.

Returns
Version
Since
1.0
Exceptions
InternalErrorExceptionAn internal error has occurred.

◆ Write()

void peak::core::Port::Write ( uint64_t address,
const std::vector< uint8_t > & bytes ) const
inline

Writes a given amount of bytes at a given address.

Parameters
[in]addressThe address to write at.
[in]bytesThe bytes to write.
Since
1.0
Exceptions
InvalidAddressExceptionAddress is invalid
OutOfRangeExceptionThe given value is out of range
IOExceptionA communication error has occured, e.g. when the device is disconnected.
InternalErrorExceptionAn internal error has occurred.

◆ ClassCreator< Port >

friend class ClassCreator< Port >
friend

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