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

#include <BFGTLUtilities.hpp>

Inheritance diagram for BFGTLUtilities::PRIVATE_IMP::CategoryNodeBase:
BFGTLUtilities::PRIVATE_IMP::ValueNodeBase BFGTLUtilities::BaseNode BFGTLUtilities::CategoryNode

Public Types

typedef std::vector< std::string > FeatureNames
 
typedef BaseNode Feature
 
typedef std::vector< FeatureFeatures
 

Public Member Functions

BFS64 featureCount (BFVOID) const
 
FeatureNames featureNames (BFVOID) const
 
bool enumerateFeatureName (const BFS64 index, BFCHAR *const hBuf, BFSIZET *const pSize) const
 
Features features (BFVOID) const
 
bool getFeature (const BFS64 index, Feature *const pFeature) const
 
- 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

bool PRIVATE_IMP::CategoryNodeBase::enumerateFeatureName ( const BFS64  index,
BFCHAR *const  hBuf,
BFSIZET *const  pSize 
) const

Iteratively retrieve the child feature names for the category.

Parameters
[in]index- The feature index.
[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 feature name cannot be retrieved.

References BFCiException::check().

1151 {
1152  size_t iSize;
1153  BFCiException::check((*m_pd)->m_hBoard, BFGTLNodeRead(*m_pd->m_nodePtr, BFGTL_NODE_FEATURE_NAMES, nullptr, &iSize) );
1154 
1155  std::vector<char> iVal (iSize);
1156  BFCiException::check((*m_pd)->m_hBoard, BFGTLNodeRead(*m_pd->m_nodePtr, BFGTL_NODE_FEATURE_NAMES, iVal.data(), &iSize) );
1157 
1158  size_t *strOffsets = reinterpret_cast<size_t*>(iVal.data());
1159 
1160  FeatureNames fNames;
1161  for (size_t i = 0; *strOffsets; i++, strOffsets++)
1162  {
1163  if (index == i)
1164  return BufInHelpers::set_str(&iVal[*strOffsets], hBuf, pSize);
1165  }
1166 
1167  return false;
1168 }
std::vector< std::string > FeatureNames
Definition: BFGTLUtilities.hpp:461
PrivateData * m_pd
Definition: BFGTLUtilities.hpp:304
static void check(Bd hBoard, const BFU32 error)
Definition: BFException.cpp:212
BFS64 PRIVATE_IMP::CategoryNodeBase::featureCount ( BFVOID  ) const

Return the number of child features for the category.

Returns
The number of child features for the category.
Exceptions
BFCiException- Thrown if the node featureCount couldn't be determined.

References BFCiException::check().

1108 {
1109  BFS64 iVal;
1110  size_t iSize = sizeof(iVal);
1111  BFCiException::check((*m_pd)->m_hBoard, BFGTLNodeRead(*m_pd->m_nodePtr, BFGTL_NODE_FEATURE_COUNT, &iVal, &iSize) );
1112  return iVal;
1113 }
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::CategoryNodeBase::FeatureNames PRIVATE_IMP::CategoryNodeBase::featureNames ( BFVOID  ) const

Return a list of the child feature names for the category.

Returns
A list of the child feature names for the category.
Exceptions
BFCiException- Thrown if the node featureNames couldn't be determined.

References BFCiException::check().

1123 {
1124  size_t iSize;
1125  BFCiException::check((*m_pd)->m_hBoard, BFGTLNodeRead(*m_pd->m_nodePtr, BFGTL_NODE_FEATURE_NAMES, nullptr, &iSize) );
1126 
1127  std::vector<char> iVal (iSize);
1128  BFCiException::check((*m_pd)->m_hBoard, BFGTLNodeRead(*m_pd->m_nodePtr, BFGTL_NODE_FEATURE_NAMES, iVal.data(), &iSize) );
1129 
1130  size_t *strOffsets = reinterpret_cast<size_t*>(iVal.data());
1131 
1132  FeatureNames fNames;
1133  while (*strOffsets)
1134  fNames.push_back(&iVal[*strOffsets++]);
1135 
1136  return fNames;
1137 }
std::vector< std::string > FeatureNames
Definition: BFGTLUtilities.hpp:461
PrivateData * m_pd
Definition: BFGTLUtilities.hpp:304
static void check(Bd hBoard, const BFU32 error)
Definition: BFException.cpp:212
PRIVATE_IMP::CategoryNodeBase::Features PRIVATE_IMP::CategoryNodeBase::features ( BFVOID  ) const

Return a list of the child feature nodes for the category.

Returns
A list of the child feature nodes for the category.
Exceptions
BFCiException- Thrown if the node features couldn't be found and opened.
1178 {
1179  Features fs;
1180  for (auto const& fNames : featureNames())
1181  fs.push_back( m_pd->m_nodePtr->m_device.getNode(fNames) );
1182  return fs;
1183 }
FeatureNames featureNames(BFVOID) const
Definition: BFGTLUtilities.cpp:1122
PrivateData * m_pd
Definition: BFGTLUtilities.hpp:304
std::vector< Feature > Features
Definition: BFGTLUtilities.hpp:463
bool PRIVATE_IMP::CategoryNodeBase::getFeature ( const BFS64  index,
Feature *const  pFeature 
) const

Retrieve the feature at the given index.

Parameters
[in]index- The feature index.
[out]pFeature- The feature handle pointer.
Returns
True if the feature exists, false otherwise.
Exceptions
BFCiException- Thrown if the feature name cannot be retrieved.
1196 {
1197  const auto features = featureNames();
1198  if (features.size() <= (size_t)index)
1199  return false;
1200 
1201  *pFeature = m_pd->m_nodePtr->m_device.getNode(features[(size_t)index]);
1202  return true;
1203 }
FeatureNames featureNames(BFVOID) const
Definition: BFGTLUtilities.cpp:1122
Features features(BFVOID) const
Definition: BFGTLUtilities.cpp:1177
PrivateData * m_pd
Definition: BFGTLUtilities.hpp:304

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