Buffer Interface
Public Types | Public Member Functions | List of all members
BFGTLUtilities::PRIVATE_IMP::EnumerationNodeBase Struct Reference

#include <BFGTLUtilities.hpp>

Inheritance diagram for BFGTLUtilities::PRIVATE_IMP::EnumerationNodeBase:
BFGTLUtilities::PRIVATE_IMP::ValueNodeBase BFGTLUtilities::BaseNode BFGTLUtilities::EnumerationNode

Public Types

typedef BFS64 Value
 
typedef std::vector< std::string > EntryStrings
 
typedef std::vector< ValueEntryValues
 
typedef NodeImpT< EnumEntryNodeBase, NodeType::EnumEntryEntry
 
typedef std::vector< EntryEntries
 

Public Member Functions

Value entryValue (BFVOID) const
 
std::string entryName (BFVOID) const
 
bool getEntryName (BFCHAR *const hBuf, BFSIZET *const pSize) const
 
std::string entrySymbolic (BFVOID) const
 
bool getEntrySymbolic (BFCHAR *const hBuf, BFSIZET *const pSize) const
 
BFS64 entryCount (BFVOID) const
 
EntryValues entryValues (BFVOID) const
 
bool enumerateEntryValue (const BFS64 index, Value *const pVal) const
 
EntryStrings entryNames (BFVOID) const
 
bool enumerateEntryName (const BFS64 index, BFCHAR *const hBuf, BFSIZET *const pSize) const
 
EntryStrings entrySymbolics (BFVOID) const
 
bool enumerateEntrySymbolic (const BFS64 index, BFCHAR *const hBuf, BFSIZET *const pSize) const
 
Entry entry (BFVOID) const
 
Entries entries (BFVOID) const
 
bool enumerateEntry (const BFS64 index, Entry *const pEntry) const
 
BFVOID setEntryValue (const Value val)
 
BFVOID setEntryName (std::string const &name)
 
BFVOID setEntryName (const BFCHAR *const name)
 
BFVOID setEntrySymbolic (std::string const &symbolic)
 
BFVOID setEntrySymbolic (const BFCHAR *const symbolic)
 
- Public Member Functions inherited from BFGTLUtilities::PRIVATE_IMP::ValueNodeBase
std::string toString (BFVOID) const
 
bool getToString (BFCHAR *const hBuf, BFSIZET *const pSize) const
 
BFVOID fromString (std::string const &strVal)
 
BFVOID fromString (const BFCHAR *const strVal)
 
- Public Member Functions inherited from BFGTLUtilities::BaseNode
 BaseNode (BFVOID)
 
 BaseNode (BaseNode const &to_alias)
 
 BaseNode (BaseNode &&to_take)
 
virtual ~BaseNode (BFVOID)
 
BaseNodeoperator= (BaseNode const &to_alias)
 
BaseNodeoperator= (BaseNode &&to_take)
 
bool isValid (BFVOID) const
 
 operator bool (BFVOID) const
 
bool isNull (BFVOID) const
 
bool operator! (BFVOID) const
 
bool operator== (BaseNode const &other) const
 
bool operator!= (BaseNode const &other) const
 
std::string name (BFVOID) const
 
bool getName (BFCHAR *const hBuf, BFSIZET *const pSize) const
 
std::string displayName (BFVOID) const
 
bool getDisplayName (BFCHAR *const hBuf, BFSIZET *const pSize) const
 
std::string toolTip (BFVOID) const
 
bool getToolTip (BFCHAR *const hBuf, BFSIZET *const pSize) const
 
std::string description (BFVOID) const
 
bool getDescription (BFCHAR *const hBuf, BFSIZET *const pSize) const
 
NodeType type (BFVOID) const
 
Access access (BFVOID) const
 
bool ignoreCache (BFVOID) const
 
BFVOID setIgnoreCache (const bool ignore)
 

Additional Inherited Members

- Static Public Attributes inherited from BFGTLUtilities::BaseNode
static const NodeType Type = NodeType::Base
 
- Protected Member Functions inherited from BFGTLUtilities::BaseNode
virtual void copy (BaseNode const &to_alias)
 
virtual void copy (BaseNode &&to_take)
 
- Protected Attributes inherited from BFGTLUtilities::BaseNode
PrivateData * m_pd
 

Member Typedef Documentation

Member Function Documentation

PRIVATE_IMP::EnumerationNodeBase::Entries PRIVATE_IMP::EnumerationNodeBase::entries ( BFVOID  ) const

Return a list of the enumeration entry nodes.

Returns
A list of the enumeration entry nodes.
Exceptions
BFCiException- Thrown if the node entries couldn't be found and opened.
1468 {
1469  Entries es;
1470  for (auto const& eName : entryNames())
1471  es.push_back( m_pd->m_nodePtr->m_device.getNode(eName) );
1472  return es;
1473 }
EntryStrings entryNames(BFVOID) const
Definition: BFGTLUtilities.cpp:1347
PrivateData * m_pd
Definition: BFGTLUtilities.hpp:304
std::vector< Entry > Entries
Definition: BFGTLUtilities.hpp:486
PRIVATE_IMP::EnumerationNodeBase::Entry PRIVATE_IMP::EnumerationNodeBase::entry ( BFVOID  ) const

Return the current enumeration entry node.

Returns
The current enumeration entry node.
Exceptions
BFCiException- Thrown if the node entry couldn't be found and opened.
1456 {
1457  return m_pd->m_nodePtr->m_device.getNode(entryName());
1458 }
std::string entryName(BFVOID) const
Definition: BFGTLUtilities.cpp:1229
PrivateData * m_pd
Definition: BFGTLUtilities.hpp:304
BFS64 PRIVATE_IMP::EnumerationNodeBase::entryCount ( BFVOID  ) const

Return the number of entries in this enumeration.

Returns
The number of entries in this enumeration.
Exceptions
BFCiException- Thrown if the node entry count couldn't determined.

References BFCiException::check().

1296 {
1297  BFS64 iVal;
1298  size_t iSize = sizeof(iVal);
1299  BFCiException::check((*m_pd)->m_hBoard, BFGTLNodeRead(*m_pd->m_nodePtr, BFGTL_NODE_ENTRY_COUNT, &iVal, &iSize) );
1300  return iVal;
1301 }
PrivateData * m_pd
Definition: BFGTLUtilities.hpp:304
static void check(Bd hBoard, const BFU32 error)
Definition: BFException.cpp:212
long long BFS64
Definition: BFTypeNT.h:54
std::string PRIVATE_IMP::EnumerationNodeBase::entryName ( BFVOID  ) const

Return the node name of the currently selected enumeration entry.

Returns
The node name of the currently selected enumeration entry.
Exceptions
BFCiException- Thrown if the node current entry name couldn't determined.

References BFCiException::check().

1230 {
1231  size_t iSize;
1232  BFCiException::check((*m_pd)->m_hBoard, BFGTLNodeRead(*m_pd->m_nodePtr, BFGTL_NODE_ENTRY_NAME, nullptr, &iSize) );
1233 
1234  std::vector<char> iVal (iSize);
1235  BFCiException::check((*m_pd)->m_hBoard, BFGTLNodeRead(*m_pd->m_nodePtr, BFGTL_NODE_ENTRY_NAME, iVal.data(), &iSize) );
1236 
1237  return iVal.data();
1238 }
PrivateData * m_pd
Definition: BFGTLUtilities.hpp:304
static void check(Bd hBoard, const BFU32 error)
Definition: BFException.cpp:212
PRIVATE_IMP::EnumerationNodeBase::EntryStrings PRIVATE_IMP::EnumerationNodeBase::entryNames ( BFVOID  ) const

Return a list of the enumeration entries' node names.

Returns
A list of the enumeration entries' node names.
Exceptions
BFCiException- Thrown if the node entry names couldn't be determined.

References BFCiException::check().

1348 {
1349  size_t iSize;
1350  BFCiException::check((*m_pd)->m_hBoard, BFGTLNodeRead(*m_pd->m_nodePtr, BFGTL_NODE_ENTRY_NAMES, nullptr, &iSize) );
1351 
1352  std::vector<char> iVal (iSize);
1353  BFCiException::check((*m_pd)->m_hBoard, BFGTLNodeRead(*m_pd->m_nodePtr, BFGTL_NODE_ENTRY_NAMES, iVal.data(), &iSize) );
1354 
1355  size_t *strOffsets = reinterpret_cast<size_t*>(iVal.data());
1356 
1357  EntryStrings eNames;
1358  while (*strOffsets)
1359  eNames.push_back(&iVal[*strOffsets++]);
1360 
1361  return eNames;
1362 }
PrivateData * m_pd
Definition: BFGTLUtilities.hpp:304
static void check(Bd hBoard, const BFU32 error)
Definition: BFException.cpp:212
std::vector< std::string > EntryStrings
Definition: BFGTLUtilities.hpp:483
std::string PRIVATE_IMP::EnumerationNodeBase::entrySymbolic ( BFVOID  ) const

Return the symbolic name of the currently selected enumeration entry.

Returns
The symbolic name of the currently selected enumeration entry.
Exceptions
BFCiException- Thrown if the node current entry symbolic name couldn't determined.

References BFCiException::check().

1263 {
1264  size_t iSize;
1265  BFCiException::check((*m_pd)->m_hBoard, BFGTLNodeRead(*m_pd->m_nodePtr, BFGTL_NODE_SYMBOLIC, nullptr, &iSize) );
1266 
1267  std::vector<char> iVal (iSize);
1268  BFCiException::check((*m_pd)->m_hBoard, BFGTLNodeRead(*m_pd->m_nodePtr, BFGTL_NODE_SYMBOLIC, iVal.data(), &iSize) );
1269 
1270  return iVal.data();
1271 }
PrivateData * m_pd
Definition: BFGTLUtilities.hpp:304
static void check(Bd hBoard, const BFU32 error)
Definition: BFException.cpp:212
PRIVATE_IMP::EnumerationNodeBase::EntryStrings PRIVATE_IMP::EnumerationNodeBase::entrySymbolics ( BFVOID  ) const

Return a list of the enumeration entries' symbolic names.

Returns
A list of the enumeration entries' symbolic names.
Exceptions
BFCiException- Thrown if the node entry symbolic names couldn't be determined.

References BFCiException::check().

1402 {
1403  size_t iSize;
1404  BFCiException::check((*m_pd)->m_hBoard, BFGTLNodeRead(*m_pd->m_nodePtr, BFGTL_NODE_ENTRY_SYMBOLICS, nullptr, &iSize) );
1405 
1406  std::vector<char> iVal (iSize);
1407  BFCiException::check((*m_pd)->m_hBoard, BFGTLNodeRead(*m_pd->m_nodePtr, BFGTL_NODE_ENTRY_SYMBOLICS, iVal.data(), &iSize) );
1408 
1409  size_t *strOffsets = reinterpret_cast<size_t*>(iVal.data());
1410 
1411  EntryStrings eNames;
1412  while (*strOffsets)
1413  eNames.push_back(&iVal[*strOffsets++]);
1414 
1415  return eNames;
1416 }
PrivateData * m_pd
Definition: BFGTLUtilities.hpp:304
static void check(Bd hBoard, const BFU32 error)
Definition: BFException.cpp:212
std::vector< std::string > EntryStrings
Definition: BFGTLUtilities.hpp:483
PRIVATE_IMP::EnumerationNodeBase::Value PRIVATE_IMP::EnumerationNodeBase::entryValue ( BFVOID  ) const

Return the integer value of the currently selected enumeration entry.

Returns
The integer value of the currently selected enumeration entry.
Exceptions
BFCiException- Thrown if the node current entry value couldn't be read.

References BFCiException::check().

1215 {
1216  BFS64 iVal;
1217  size_t iSize = sizeof(iVal);
1218  BFCiException::check((*m_pd)->m_hBoard, BFGTLNodeRead(*m_pd->m_nodePtr, BFGTL_NODE_VALUE, &iVal, &iSize) );
1219  return iVal;
1220 }
PrivateData * m_pd
Definition: BFGTLUtilities.hpp:304
static void check(Bd hBoard, const BFU32 error)
Definition: BFException.cpp:212
long long BFS64
Definition: BFTypeNT.h:54
PRIVATE_IMP::EnumerationNodeBase::EntryValues PRIVATE_IMP::EnumerationNodeBase::entryValues ( BFVOID  ) const

Return a list of the enumeration entries' integer values.

Returns
A list of the enumeration entries' integer values.
Exceptions
BFCiException- Thrown if the node entry values couldn't be read.

References BFCiException::check().

1311 {
1312  size_t iSize;
1313  BFCiException::check((*m_pd)->m_hBoard, BFGTLNodeRead(*m_pd->m_nodePtr, BFGTL_NODE_ENTRY_VALUES, nullptr, &iSize) );
1314 
1315  std::vector<BFU8> iVal (iSize);
1316  BFCiException::check((*m_pd)->m_hBoard, BFGTLNodeRead(*m_pd->m_nodePtr, BFGTL_NODE_ENTRY_VALUES, iVal.data(), &iSize) );
1317 
1318  const size_t entryCnt = iSize / sizeof(BFS64);
1319  BFS64 *entryVals = reinterpret_cast<BFS64*>(iVal.data());
1320  return EntryValues (entryVals, entryVals + entryCnt);
1321 }
std::vector< Value > EntryValues
Definition: BFGTLUtilities.hpp:484
PrivateData * m_pd
Definition: BFGTLUtilities.hpp:304
static void check(Bd hBoard, const BFU32 error)
Definition: BFException.cpp:212
long long BFS64
Definition: BFTypeNT.h:54
bool PRIVATE_IMP::EnumerationNodeBase::enumerateEntry ( const BFS64  index,
Entry *const  pEntry 
) const

Retrieve an enumeration entry for the given index.

Parameters
[in]index- The index of the enumeration entry to retrieve.
[out]pEntry- The enumeration entry handle.
Returns
True if the entry was successfully retrieve, otherwise false.
Exceptions
BFCiException- Thrown if the node entry couldn't be found and opened.
1486 {
1487  const auto ens = entryNames();
1488  if (ens.size() <= (size_t)index)
1489  return false;
1490 
1491  *pEntry = m_pd->m_nodePtr->m_device.getNode(ens[(size_t)index]);
1492  return true;
1493 }
EntryStrings entryNames(BFVOID) const
Definition: BFGTLUtilities.cpp:1347
PrivateData * m_pd
Definition: BFGTLUtilities.hpp:304
bool PRIVATE_IMP::EnumerationNodeBase::enumerateEntryName ( const BFS64  index,
BFCHAR *const  hBuf,
BFSIZET *const  pSize 
) const

Retrieve the enumeration entry string name for the given index.

Parameters
[in]index- The index of the enumeration entry to query.
[out]hBuf- The string buffer pointer, filled with as much data as is possible. May be nullptr.
[in,out]pSize- As input, the size of hBuf. As output, the buffer size requried.
Returns
True on success, false otherwise.
Exceptions
BFCiException- Thrown if the node entry names couldn't be determined.

References BFCiException::check().

1376 {
1377  size_t iSize;
1378  BFCiException::check((*m_pd)->m_hBoard, BFGTLNodeRead(*m_pd->m_nodePtr, BFGTL_NODE_ENTRY_NAMES, nullptr, &iSize) );
1379 
1380  std::vector<char> iVal (iSize);
1381  BFCiException::check((*m_pd)->m_hBoard, BFGTLNodeRead(*m_pd->m_nodePtr, BFGTL_NODE_ENTRY_NAMES, iVal.data(), &iSize) );
1382 
1383  size_t *strOffsets = reinterpret_cast<size_t*>(iVal.data());
1384 
1385  for (BFS64 i = 0; *strOffsets; i++, strOffsets++)
1386  {
1387  if (index == i)
1388  return BufInHelpers::set_str(&iVal[*strOffsets], hBuf, pSize);
1389  }
1390 
1391  return false;
1392 }
PrivateData * m_pd
Definition: BFGTLUtilities.hpp:304
static void check(Bd hBoard, const BFU32 error)
Definition: BFException.cpp:212
long long BFS64
Definition: BFTypeNT.h:54
bool PRIVATE_IMP::EnumerationNodeBase::enumerateEntrySymbolic ( const BFS64  index,
BFCHAR *const  hBuf,
BFSIZET *const  pSize 
) const

Retrieve the enumeration entry string symbolic for the given index.

Parameters
[in]index- The index of the enumeration entry to query.
[out]hBuf- The string buffer pointer, filled with as much data as is possible. May be nullptr.
[in,out]pSize- As input, the size of hBuf. As output, the buffer size requried.
Returns
True on success, false otherwise.
Exceptions
BFCiException- Thrown if the node entry symbolic couldn't be determined.

References BFCiException::check().

1430 {
1431  size_t iSize;
1432  BFCiException::check((*m_pd)->m_hBoard, BFGTLNodeRead(*m_pd->m_nodePtr, BFGTL_NODE_ENTRY_SYMBOLICS, nullptr, &iSize) );
1433 
1434  std::vector<char> iVal (iSize);
1435  BFCiException::check((*m_pd)->m_hBoard, BFGTLNodeRead(*m_pd->m_nodePtr, BFGTL_NODE_ENTRY_SYMBOLICS, iVal.data(), &iSize) );
1436 
1437  size_t *strOffsets = reinterpret_cast<size_t*>(iVal.data());
1438 
1439  for (BFS64 i = 0; *strOffsets; i++, strOffsets++)
1440  {
1441  if (index == i)
1442  return BufInHelpers::set_str(&iVal[*strOffsets], hBuf, pSize);
1443  }
1444 
1445  return false;
1446 }
PrivateData * m_pd
Definition: BFGTLUtilities.hpp:304
static void check(Bd hBoard, const BFU32 error)
Definition: BFException.cpp:212
long long BFS64
Definition: BFTypeNT.h:54
bool PRIVATE_IMP::EnumerationNodeBase::enumerateEntryValue ( const BFS64  index,
Value *const  pVal 
) const

Retrieve the enumeration entry integer value for the given index.

Returns
True on success, false otherwise.
Exceptions
BFCiException- Thrown if the node entry values couldn't be read.
1331 {
1332  const auto evs = entryValues();
1333  if (evs.size() <= (size_t)index)
1334  return false;
1335 
1336  *pVal = evs[(size_t)index];
1337  return true;
1338 }
EntryValues entryValues(BFVOID) const
Definition: BFGTLUtilities.cpp:1310
bool PRIVATE_IMP::EnumerationNodeBase::getEntryName ( BFCHAR *const  hBuf,
BFSIZET *const  pSize 
) const

Return the node name of the currently selected enumeration entry.

Parameters
[out]hBuf- The string buffer pointer, filled with as much data as is possible. May be nullptr.
[in,out]pSize- As input, the size of hBuf. As output, the buffer size requried.
Returns
True on success, false otherwise.
Exceptions
BFCiException- Thrown if the node current entry name couldn't determined.
1251 {
1252  return BufInHelpers::set_str(entryName(), hBuf, pSize);
1253 }
std::string entryName(BFVOID) const
Definition: BFGTLUtilities.cpp:1229
bool PRIVATE_IMP::EnumerationNodeBase::getEntrySymbolic ( BFCHAR *const  hBuf,
BFSIZET *const  pSize 
) const

Return the symbolic name of the currently selected enumeration entry.

Parameters
[out]hBuf- The string buffer pointer, filled with as much data as is possible. May be nullptr.
[in,out]pSize- As input, the size of hBuf. As output, the buffer size requried.
Returns
True on success, false otherwise.
Exceptions
BFCiException- Thrown if the node current entry symbolic name couldn't determined.
1284 {
1285  return BufInHelpers::set_str(entrySymbolic(), hBuf, pSize);
1286 }
std::string entrySymbolic(BFVOID) const
Definition: BFGTLUtilities.cpp:1262
BFVOID PRIVATE_IMP::EnumerationNodeBase::setEntryName ( std::string const &  name)

Set the current entry by its node name.

Exceptions
BFCiException- Thrown if the node entry couldn't selected.

References BFCiException::check().

1512 {
1513  BFCiException::check((*m_pd)->m_hBoard, BFGTLNodeWrite(*m_pd->m_nodePtr, BFGTL_NODE_ENTRY_NAME, name.c_str(), name.length()) );
1514 }
std::string name(BFVOID) const
Definition: BFGTLUtilities.cpp:503
PrivateData * m_pd
Definition: BFGTLUtilities.hpp:304
static void check(Bd hBoard, const BFU32 error)
Definition: BFException.cpp:212
BFVOID PRIVATE_IMP::EnumerationNodeBase::setEntryName ( const BFCHAR *const  name)

Set the current entry by its node name.

Exceptions
BFCiException- Thrown if the node entry couldn't selected.
1522 {
1523  const std::string cppName (name);
1524  setEntryName(cppName);
1525 }
std::string name(BFVOID) const
Definition: BFGTLUtilities.cpp:503
BFVOID setEntryName(std::string const &name)
Definition: BFGTLUtilities.cpp:1511
BFVOID PRIVATE_IMP::EnumerationNodeBase::setEntrySymbolic ( std::string const &  symbolic)

Set the current entry by its symbolic name.

Exceptions
BFCiException- Thrown if the node entry couldn't selected.

References BFCiException::check().

1533 {
1534  BFCiException::check((*m_pd)->m_hBoard, BFGTLNodeWrite(*m_pd->m_nodePtr, BFGTL_NODE_SYMBOLIC, symbolic.c_str(), symbolic.length()) );
1535 }
PrivateData * m_pd
Definition: BFGTLUtilities.hpp:304
static void check(Bd hBoard, const BFU32 error)
Definition: BFException.cpp:212
BFVOID PRIVATE_IMP::EnumerationNodeBase::setEntrySymbolic ( const BFCHAR *const  symbolic)

Set the current entry by its symbolic name.

Exceptions
BFCiException- Thrown if the node entry couldn't selected.
1543 {
1544  const std::string cppSymbolic (symbolic);
1545  setEntrySymbolic(cppSymbolic);
1546 }
BFVOID setEntrySymbolic(std::string const &symbolic)
Definition: BFGTLUtilities.cpp:1532
BFVOID PRIVATE_IMP::EnumerationNodeBase::setEntryValue ( const Value  val)

Set the current entry by its integer value.

Exceptions
BFCiException- Thrown if the node entry couldn't selected.

References BFCiException::check().

1501 {
1502  BFS64 iVal = val;
1503  BFCiException::check((*m_pd)->m_hBoard, BFGTLNodeWrite(*m_pd->m_nodePtr, BFGTL_NODE_VALUE, &iVal, sizeof(iVal)) );
1504 }
PrivateData * m_pd
Definition: BFGTLUtilities.hpp:304
static void check(Bd hBoard, const BFU32 error)
Definition: BFException.cpp:212
long long BFS64
Definition: BFTypeNT.h:54

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