Pylon::AccessModeSet#
Collection of access mode bits. More…
#include <pylon/DeviceAccessMode.h>
Public Functions#
Name | |
---|---|
AccessModeSet(void ) Default constructor creates an empty set. | |
AccessModeSet(EDeviceAccessMode am) Converts an access mode into a set. | |
AccessModeSet(const AccessModeSet & ams) Copy constructor. | |
AccessModeSet & | set(size_t pos) Sets the bit at position pos. |
AccessModeSet & | reset() Resets all bits to zero. |
bool | any() const Returns whether any of the bits is set (i.e., whether at least one bit in the AccessModeSet is set to one). |
bool | none() const Returns whether any of the bits is set (i.e., whether at least one bit in the AccessModeSet is set to one). |
bool | test(size_t pos) const Returns whether the bit at position pos is set (i.e., whether it is one). |
unsigned long | to_ulong() const Returns an unsigned long with the integer value that has the same bits set as the AccessModeSet. |
Detailed Description#
Collection of access mode bits.
See:
- The method of IDevice::Open() uses it to define a default value.
- The global operator |( EDeviceAccessMode lhs, EDeviceAccessMode rhs ) allows to combine two modes to a set.
Low Level API:
This set is used when a device is opened. The combination of different access modes specifies how the device is opened. Not all combinations may be allowed because the device implementations have certain restrictions.
Used for defining how a device is accessed.
AccessModeSet a = Exclusive | Stream;
if (a.test( Exclusive ))
{
// Exclusive implies Control access, so set it also
a |= Control;
}
Public Functions Documentation#
function AccessModeSet#
Default constructor creates an empty set.
function AccessModeSet#
Converts an access mode into a set.
function AccessModeSet#
Copy constructor.
function set#
Sets the bit at position pos.
Parameters:
- pos Order position of the bit whose value is modified. Order positions are counted from the rightmost bit, which is order position 0.
Return: *this
function reset#
Resets all bits to zero.
Return: *this
function any#
Returns whether any of the bits is set (i.e., whether at least one bit in the AccessModeSet is set to one).
Return: true if any of the bits in the AccessModeSet is set (to one), and false otherwise.
function none#
Returns whether any of the bits is set (i.e., whether at least one bit in the AccessModeSet is set to one).
Return: true if any of the bits in the AccessModeSet is set (to one), and false otherwise.
function test#
Returns whether the bit at position pos is set (i.e., whether it is one).
Parameters:
- pos Order position of the bit whose value is modified. Order positions are counted from the rightmost bit, which is order position 0.
Return: true if the bit at position pos is set, and false if it is not set.
function to_ulong#
Returns an unsigned long with the integer value that has the same bits set as the AccessModeSet.
Return: Integer value with the same bit representation as the AccessModeSet object.