Buffer Interface
Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes | List of all members
BFGTLUtilities::BaseNode Class Reference

Base class for BFGTLUtilities::Device node access and modification. More...

#include <BFGTLUtilities.hpp>

Inheritance diagram for BFGTLUtilities::BaseNode:
BFGTLUtilities::PRIVATE_IMP::NodeImpT< NodeT, NODE_TYPE > BFGTLUtilities::PRIVATE_IMP::PortNodeBase BFGTLUtilities::PRIVATE_IMP::ValueNodeBase BFGTLUtilities::PortNode BFGTLUtilities::PRIVATE_IMP::BooleanNodeBase BFGTLUtilities::PRIVATE_IMP::CategoryNodeBase BFGTLUtilities::PRIVATE_IMP::CommandNodeBase BFGTLUtilities::PRIVATE_IMP::EnumEntryNodeBase BFGTLUtilities::PRIVATE_IMP::EnumerationNodeBase BFGTLUtilities::PRIVATE_IMP::FloatNodeBase BFGTLUtilities::PRIVATE_IMP::IntegerNodeBase BFGTLUtilities::PRIVATE_IMP::RegisterNodeBase BFGTLUtilities::PRIVATE_IMP::StringNodeBase BFGTLUtilities::ValueNode

Public Member Functions

 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)
 

Static Public Attributes

static const NodeType Type = NodeType::Base
 

Protected Member Functions

virtual void copy (BaseNode const &to_alias)
 
virtual void copy (BaseNode &&to_take)
 

Protected Attributes

PrivateData * m_pd
 

Detailed Description

Base class for BFGTLUtilities::Device node access and modification.

Constructor & Destructor Documentation

BaseNode::BaseNode ( BFVOID  )

Initialize a BaseNode instance with no data.

365  : m_pd ( new PrivateData )
366 { }
PrivateData * m_pd
Definition: BFGTLUtilities.hpp:304
BaseNode::BaseNode ( BaseNode const &  to_alias)

Initialize a BaseNode instance referencing the same data as the given node.

References m_pd.

372  : m_pd ( new PrivateData )
373 {
374  m_pd->m_nodePtr = to_alias.m_pd->m_nodePtr;
375 }
PrivateData * m_pd
Definition: BFGTLUtilities.hpp:304
BaseNode::BaseNode ( BaseNode &&  to_take)

Initialize a BaseNode instance referencing the same data as the given node. to_take will lose its reference.

381  : m_pd (to_take.m_pd)
382 {
383  to_take.m_pd = nullptr;
384 }
PrivateData * m_pd
Definition: BFGTLUtilities.hpp:304
BaseNode::~BaseNode ( BFVOID  )
virtual

Cleanup and deallocate the node.

References m_pd.

390 {
391  delete m_pd;
392 }
PrivateData * m_pd
Definition: BFGTLUtilities.hpp:304

Member Function Documentation

Access BaseNode::access ( BFVOID  ) const

Retrieve the node accessibility.

Returns
The accessibility of the referenced Device node.
Exceptions
BFCiException- Thrown if the node accessibility cannot be determined.

References BFCiException::check(), and m_pd.

655 {
656  BFU32 accessCode;
657  size_t iSize = sizeof(accessCode);
658  BFCiException::check((*m_pd)->m_hBoard, BFGTLNodeRead(*m_pd->m_nodePtr, BFGTL_NODE_ACCESS, &accessCode, &iSize) );
659  return (Access)accessCode;
660 }
unsigned long BFU32
Definition: BFTypeNT.h:55
Access
Definition: BFGTLUtilities.hpp:225
PrivateData * m_pd
Definition: BFGTLUtilities.hpp:304
static void check(Bd hBoard, const BFU32 error)
Definition: BFException.cpp:212
void BaseNode::copy ( BaseNode const &  to_alias)
protectedvirtual

References m_pd.

Referenced by operator=().

417 {
418  if (*this != to_alias)
419  m_pd->m_nodePtr = to_alias.m_pd->m_nodePtr;
420 }
PrivateData * m_pd
Definition: BFGTLUtilities.hpp:304
void BaseNode::copy ( BaseNode &&  to_take)
protectedvirtual

References m_pd.

422 {
423  if (*this != to_take)
424  {
425  delete m_pd;
426  m_pd = to_take.m_pd;
427  to_take.m_pd = nullptr;
428  }
429 }
PrivateData * m_pd
Definition: BFGTLUtilities.hpp:304
std::string BaseNode::description ( BFVOID  ) const

Retrieve the node description text. The node must be valid.

Returns
The description text of the referenced Device node.
Exceptions
BFCiException- Thrown if the node description text cannot be retrieved.

References BFCiException::check(), and m_pd.

Referenced by getDescription().

606 {
607  size_t iSize;
608  BFCiException::check((*m_pd)->m_hBoard, BFGTLNodeRead(*m_pd->m_nodePtr, BFGTL_NODE_DESCRIPTION, nullptr, &iSize) );
609 
610  std::vector<char> cData (iSize);
611  BFCiException::check((*m_pd)->m_hBoard, BFGTLNodeRead(*m_pd->m_nodePtr, BFGTL_NODE_DESCRIPTION, cData.data(), &iSize) );
612  cData.back() = 0;
613 
614  return cData.data();
615 }
PrivateData * m_pd
Definition: BFGTLUtilities.hpp:304
static void check(Bd hBoard, const BFU32 error)
Definition: BFException.cpp:212
std::string BaseNode::displayName ( BFVOID  ) const

Retrieve the node display name text. The node must be valid.

Returns
The display name text of the referenced Device node.
Exceptions
BFCiException- Thrown if the node display name text cannot be retrieved.

References BFCiException::check(), and m_pd.

Referenced by getDisplayName().

538 {
539  size_t iSize;
540  BFCiException::check((*m_pd)->m_hBoard, BFGTLNodeRead(*m_pd->m_nodePtr, BFGTL_NODE_DISPLAY_NAME, nullptr, &iSize) );
541 
542  std::vector<char> cData (iSize);
543  BFCiException::check((*m_pd)->m_hBoard, BFGTLNodeRead(*m_pd->m_nodePtr, BFGTL_NODE_DISPLAY_NAME, cData.data(), &iSize) );
544  cData.back() = 0;
545 
546  return cData.data();
547 }
PrivateData * m_pd
Definition: BFGTLUtilities.hpp:304
static void check(Bd hBoard, const BFU32 error)
Definition: BFException.cpp:212
bool BaseNode::getDescription ( BFCHAR *const  hBuf,
BFSIZET *const  pSize 
) const

Retrieve the node description text. The node must be valid.

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 name cannot be retrieved.

References description().

628 {
629  return BufInHelpers::set_str(description(), hBuf, pSize);
630 }
std::string description(BFVOID) const
Definition: BFGTLUtilities.cpp:605
bool BaseNode::getDisplayName ( BFCHAR *const  hBuf,
BFSIZET *const  pSize 
) const

Retrieve the node display name text. The node must be valid.

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 name cannot be retrieved.

References displayName().

560 {
561  return BufInHelpers::set_str(displayName(), hBuf, pSize);
562 }
std::string displayName(BFVOID) const
Definition: BFGTLUtilities.cpp:537
bool BaseNode::getName ( BFCHAR *const  hBuf,
BFSIZET *const  pSize 
) const

Retrieve the node name string. This value is unique to each node. The node must be valid.

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 name cannot be retrieved.

References name().

526 {
527  return BufInHelpers::set_str(name(), hBuf, pSize);
528 }
std::string name(BFVOID) const
Definition: BFGTLUtilities.cpp:503
bool BaseNode::getToolTip ( BFCHAR *const  hBuf,
BFSIZET *const  pSize 
) const

Retrieve the node tool-tip text. The node must be valid.

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 name cannot be retrieved.

References toolTip().

594 {
595  return BufInHelpers::set_str(toolTip(), hBuf, pSize);
596 }
std::string toolTip(BFVOID) const
Definition: BFGTLUtilities.cpp:571
bool BaseNode::ignoreCache ( BFVOID  ) const

Whether or not to ignore any cached data.

Returns
Status of the cache ignore flag.
Exceptions
BFCiException- Thrown if the node ignore cache status cannot be determined.

References BFCiException::check(), and m_pd.

670 {
671  BFBOOL bVal;
672  size_t iSize = sizeof(bVal);
673  BFCiException::check((*m_pd)->m_hBoard, BFGTLNodeRead(*m_pd->m_nodePtr, BFGTL_NODE_IGNORE_CACHE, &bVal, &iSize) );
674  return !!bVal;
675 }
PrivateData * m_pd
Definition: BFGTLUtilities.hpp:304
static void check(Bd hBoard, const BFU32 error)
Definition: BFException.cpp:212
int BFBOOL
Definition: BFTypeNT.h:34
bool BaseNode::isNull ( BFVOID  ) const

Inverse of isValid.

Returns
False if this handle references a Device node, true otherwise.

References isValid().

457 {
458  return !isValid();
459 }
bool isValid(BFVOID) const
Definition: BFGTLUtilities.cpp:436
bool BaseNode::isValid ( BFVOID  ) const

Check whether or not this handle references a Device node.

Returns
True if this handle references a Device node, false otherwise.

References m_pd.

Referenced by isNull(), and operator!().

437 {
438  return !!m_pd->m_nodePtr;
439 }
PrivateData * m_pd
Definition: BFGTLUtilities.hpp:304
std::string BaseNode::name ( BFVOID  ) const

Retrieve the node name string. This value is unique to each node. The node must be valid.

Returns
The name of the referenced Device node.
Exceptions
BFCiException- Thrown if the node name cannot be retrieved.

References BFCiException::check(), and m_pd.

Referenced by getName(), and operator==().

504 {
505  size_t iSize;
506  BFCiException::check((*m_pd)->m_hBoard, BFGTLNodeRead(*m_pd->m_nodePtr, BFGTL_NODE_NAME, nullptr, &iSize) );
507 
508  std::vector<char> cData (iSize);
509  BFCiException::check((*m_pd)->m_hBoard, BFGTLNodeRead(*m_pd->m_nodePtr, BFGTL_NODE_NAME, cData.data(), &iSize) );
510  cData.back() = 0;
511 
512  return cData.data();
513 }
PrivateData * m_pd
Definition: BFGTLUtilities.hpp:304
static void check(Bd hBoard, const BFU32 error)
Definition: BFException.cpp:212
BaseNode::operator bool ( BFVOID  ) const

Equivalent to isValid.

Returns
True if this handle references a Device node, false otherwise.
447 {
448  return !!m_pd->m_nodePtr;
449 }
PrivateData * m_pd
Definition: BFGTLUtilities.hpp:304
bool BaseNode::operator! ( BFVOID  ) const

Equivalent to isNull.

Returns
False if this handle references a Device node, true otherwise.

References isValid().

467 {
468  return !isValid();
469 }
bool isValid(BFVOID) const
Definition: BFGTLUtilities.cpp:436
bool BaseNode::operator!= ( BaseNode const &  other) const

Determine if this node is inequivalent to a different node. Null instances are not considered equivalent.

Returns
True if either handle isNull, or if the handles reference different Device nodes. False, otherwise.
492 {
493  return !(*this == other);
494 }
BaseNode & BaseNode::operator= ( BaseNode const &  to_alias)

Make this node reference the same data as the node to_alias.

Returns
A reference to this node.

References copy().

400 {
401  copy(to_alias);
402  return *this;
403 }
virtual void copy(BaseNode const &to_alias)
Definition: BFGTLUtilities.cpp:416
BaseNode & BaseNode::operator= ( BaseNode &&  to_take)

Make this node reference the same data as the node to_take. to_take will lose its reference.

Returns
A reference to this node.

References copy().

411 {
412  copy(std::move(to_take));
413  return *this;
414 }
virtual void copy(BaseNode const &to_alias)
Definition: BFGTLUtilities.cpp:416
bool BaseNode::operator== ( BaseNode const &  other) const

Determine if this node is equivalent to a different node. Null instances are not considered equivalent.

Returns
True if the node handles are valid, and reference the same Device node. False, otherwise.

References m_pd, and name().

478 {
479  if (!(*this) || !other)
480  return false;
481 
482  return (&m_pd->m_nodePtr->m_device == &other.m_pd->m_nodePtr->m_device) && (name() == other.name());
483 }
std::string name(BFVOID) const
Definition: BFGTLUtilities.cpp:503
PrivateData * m_pd
Definition: BFGTLUtilities.hpp:304
BFVOID BaseNode::setIgnoreCache ( const bool  ignore)

Set whether or not to ignore any cached data.

Exceptions
BFCiException- Thrown if the node ignore cache status cannot be set.

References BFCiException::check(), and m_pd.

683 {
684  BFBOOL bVal = ignore;
685  BFCiException::check((*m_pd)->m_hBoard, BFGTLNodeWrite(*m_pd->m_nodePtr, BFGTL_NODE_IGNORE_CACHE, &bVal, sizeof(bVal)) );
686 }
PrivateData * m_pd
Definition: BFGTLUtilities.hpp:304
static void check(Bd hBoard, const BFU32 error)
Definition: BFException.cpp:212
int BFBOOL
Definition: BFTypeNT.h:34
std::string BaseNode::toolTip ( BFVOID  ) const

Retrieve the node tool-tip text. The node must be valid.

Returns
The tool-tip text of the referenced Device node.
Exceptions
BFCiException- Thrown if the node tool-tip text cannot be retrieved.

References BFCiException::check(), and m_pd.

Referenced by getToolTip().

572 {
573  size_t iSize;
574  BFCiException::check((*m_pd)->m_hBoard, BFGTLNodeRead(*m_pd->m_nodePtr, BFGTL_NODE_TOOL_TIP, nullptr, &iSize) );
575 
576  std::vector<char> cData (iSize);
577  BFCiException::check((*m_pd)->m_hBoard, BFGTLNodeRead(*m_pd->m_nodePtr, BFGTL_NODE_TOOL_TIP, cData.data(), &iSize) );
578  cData.back() = 0;
579 
580  return cData.data();
581 }
PrivateData * m_pd
Definition: BFGTLUtilities.hpp:304
static void check(Bd hBoard, const BFU32 error)
Definition: BFException.cpp:212
NodeType BaseNode::type ( BFVOID  ) const

Retrieve the node type.

Returns
The type of the referenced Device node.
Exceptions
BFCiException- Thrown if the node type cannot be determined.

References BFCiException::check(), and m_pd.

Referenced by BFGTLUtilities::PRIVATE_IMP::NodeImpT< NodeT, NODE_TYPE >::is_convertible().

640 {
641  BFU32 typeCode;
642  size_t iSize = sizeof(typeCode);
643  BFCiException::check((*m_pd)->m_hBoard, BFGTLNodeRead(*m_pd->m_nodePtr, BFGTL_NODE_TYPE, &typeCode, &iSize) );
644  return (NodeType)typeCode;
645 }
NodeType
Definition: BFGTLUtilities.hpp:206
unsigned long BFU32
Definition: BFTypeNT.h:55
PrivateData * m_pd
Definition: BFGTLUtilities.hpp:304
static void check(Bd hBoard, const BFU32 error)
Definition: BFException.cpp:212

Member Data Documentation

PrivateData* BFGTLUtilities::BaseNode::m_pd
protected
const NodeType BFGTLUtilities::BaseNode::Type = NodeType::Base
static

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