HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PDG_AttributeHolder Class Reference

#include <PDG_AttributeHolder.h>

+ Inheritance diagram for PDG_AttributeHolder:

Public Member Functions

 PDG_AttributeHolder ()
 Constructs an invalid attribute holder. More...
 
 PDG_AttributeHolder (PDG_AttributeHolder &&other)
 Move constructs an attribute holder. More...
 
 PDG_AttributeHolder (PDG_AttributeData *attribute, PDG_AttributeType type, uint16 flags, bool owner, bool stale)
 
 ~PDG_AttributeHolder ()
 
PDG_AttributeHolderoperator= (PDG_AttributeHolder &&other)
 Move assignment is permitted. More...
 
int64 getMemoryUsage (bool inclusive) const
 
bool isOwner () const
 Returns whether or not this holder has taken ownership of the attribute. More...
 
bool isStale () const
 
bool isConcat () const
 
bool isChanged () const
 
PDG_AttributeDataown ()
 
void swapAttributes (PDG_AttributeHolder &holder)
 
void reset ()
 Resets the holder to a nullptr, thus making it an invalid holder. More...
 
PDG_AttributeDatareset (const PDG_AttributeData *attribute, PDG_AttributeType type, uint16 flags, bool own, bool stale, bool concat)
 
PDG_AttributeDatareset (const PDG_AttributeHolder &holder, bool own, bool sync_flags)
 
template<typename Attribute = PDG_AttributeData>
const Attributeattribute () const
 Const accessor for the own attribute - could be nullptr. More...
 
template<typename Attribute = PDG_AttributeData>
Attributeattribute ()
 Non-const accessor for the own attribute - could be nullptr. More...
 
template<typename Attribute = PDG_AttributeData>
bool hasData () const
 Returns true if the underlying attribute has any data. More...
 
const PDG_AttributeDataoperator-> () const
 
PDG_AttributeDataoperator-> ()
 
const PDG_AttributeDataoperator* () const
 
PDG_AttributeDataoperator* ()
 
bool operator== (const PDG_AttributeHolder &other) const
 
bool operator!= (const PDG_AttributeHolder &other) const
 
 operator bool () const
 
template<typename Attribute >
bool typeMatch () const
 
PDG_AttributeType type () const
 Returns the attribute type. More...
 
uint16 flags () const
 Returns the attribute flags. More...
 
bool hasAnyFlags () const
 Returns true if this attribute has at least one flag set. More...
 
bool hasFlag (PDG_AttributeFlag flag) const
 Returns true if this attribute has the specified flag. More...
 
bool hasFlags (uint16 flags) const
 Returns true if this attribute has all of the specified flags set. More...
 
bool hasAnyFlags (uint16 flags) const
 Returns true if this attribute has any of the specified flags set. More...
 
bool setFlag (PDG_AttributeFlag flag, bool set)
 
bool setFlags (uint16 flags)
 
void setIsConcat (bool is_concat)
 Sets the concat bit to the specified value. More...
 
void setIsChanged (bool is_changed)
 Sets the changed bit to the specified value. More...
 
template<typename Attribute >
bool concat (const PDG_AttributeHolder &other)
 Concats the specified attribute with the attribute in this holder. More...
 
template<typename Attribute >
bool adjustSize (int offset)
 Sets the size of the attribute. More...
 
template<typename Attribute >
void clear ()
 Clears the attribute. More...
 
template<typename Attribute >
void swap (PDG_AttributeHolder &other)
 Swaps the specified attribute with the attribute in this holder. More...
 

Detailed Description

Reference to a PDG attribute instance, either owned or shared. Contains the type information for the attribute as well as various flags (no copy, export, etc).

Definition at line 24 of file PDG_AttributeHolder.h.

Constructor & Destructor Documentation

PDG_AttributeHolder::PDG_AttributeHolder ( )
inline

Constructs an invalid attribute holder.

Definition at line 28 of file PDG_AttributeHolder.h.

PDG_AttributeHolder::PDG_AttributeHolder ( PDG_AttributeHolder &&  other)
inline

Move constructs an attribute holder.

Definition at line 40 of file PDG_AttributeHolder.h.

PDG_AttributeHolder::PDG_AttributeHolder ( PDG_AttributeData attribute,
PDG_AttributeType  type,
uint16  flags,
bool  owner,
bool  stale 
)
inline

Constructs an attribute holder from an attribute data pointer, with the specified ownership

Definition at line 59 of file PDG_AttributeHolder.h.

PDG_AttributeHolder::~PDG_AttributeHolder ( )
inline

Destroys the attribute own by this holder if it exists, and the own flag is set

Definition at line 76 of file PDG_AttributeHolder.h.

Member Function Documentation

template<typename Attribute >
bool PDG_AttributeHolder::adjustSize ( int  offset)
inline

Sets the size of the attribute.

Definition at line 452 of file PDG_AttributeHolder.h.

template<typename Attribute = PDG_AttributeData>
const Attribute* PDG_AttributeHolder::attribute ( ) const
inline

Const accessor for the own attribute - could be nullptr.

Definition at line 267 of file PDG_AttributeHolder.h.

template<typename Attribute = PDG_AttributeData>
Attribute* PDG_AttributeHolder::attribute ( )
inline

Non-const accessor for the own attribute - could be nullptr.

Definition at line 274 of file PDG_AttributeHolder.h.

template<typename Attribute >
void PDG_AttributeHolder::clear ( void  )
inline

Clears the attribute.

Definition at line 459 of file PDG_AttributeHolder.h.

template<typename Attribute >
bool PDG_AttributeHolder::concat ( const PDG_AttributeHolder other)
inline

Concats the specified attribute with the attribute in this holder.

Definition at line 444 of file PDG_AttributeHolder.h.

uint16 PDG_AttributeHolder::flags ( ) const
inline

Returns the attribute flags.

Definition at line 367 of file PDG_AttributeHolder.h.

int64 PDG_AttributeHolder::getMemoryUsage ( bool  inclusive) const
inline

Returns the memory usage of the attribute, including the data only if this holder owns it.

Definition at line 102 of file PDG_AttributeHolder.h.

bool PDG_AttributeHolder::hasAnyFlags ( ) const
inline

Returns true if this attribute has at least one flag set.

Definition at line 373 of file PDG_AttributeHolder.h.

bool PDG_AttributeHolder::hasAnyFlags ( uint16  flags) const
inline

Returns true if this attribute has any of the specified flags set.

Definition at line 391 of file PDG_AttributeHolder.h.

template<typename Attribute = PDG_AttributeData>
bool PDG_AttributeHolder::hasData ( ) const
inline

Returns true if the underlying attribute has any data.

Definition at line 281 of file PDG_AttributeHolder.h.

bool PDG_AttributeHolder::hasFlag ( PDG_AttributeFlag  flag) const
inline

Returns true if this attribute has the specified flag.

Definition at line 379 of file PDG_AttributeHolder.h.

bool PDG_AttributeHolder::hasFlags ( uint16  flags) const
inline

Returns true if this attribute has all of the specified flags set.

Definition at line 385 of file PDG_AttributeHolder.h.

bool PDG_AttributeHolder::isChanged ( ) const
inline

Returns true if this attribute has been modified since the changed flag was cleared

Definition at line 132 of file PDG_AttributeHolder.h.

bool PDG_AttributeHolder::isConcat ( ) const
inline

Returns true if this attribute contains data that was concatenated from multiple input attributes

Definition at line 125 of file PDG_AttributeHolder.h.

bool PDG_AttributeHolder::isOwner ( ) const
inline

Returns whether or not this holder has taken ownership of the attribute.

Definition at line 111 of file PDG_AttributeHolder.h.

bool PDG_AttributeHolder::isStale ( ) const
inline

Returns true if this is a stale owned attribute, which happens during deserialization

Definition at line 118 of file PDG_AttributeHolder.h.

PDG_AttributeHolder::operator bool ( ) const
inline

Returns true if this holder refers to a valid attribute pointer, else false.

Definition at line 346 of file PDG_AttributeHolder.h.

bool PDG_AttributeHolder::operator!= ( const PDG_AttributeHolder other) const
inline

Compares two attribute holders for inequality - the inverse of the above function.

Definition at line 339 of file PDG_AttributeHolder.h.

const PDG_AttributeData& PDG_AttributeHolder::operator* ( ) const
inline

Const dereference, invalid to use if this holder refers to a null attribute.

Definition at line 305 of file PDG_AttributeHolder.h.

PDG_AttributeData& PDG_AttributeHolder::operator* ( )
inline

Nonconst dereference, invalid to use if this holder refers to a null attribute.

Definition at line 312 of file PDG_AttributeHolder.h.

const PDG_AttributeData* PDG_AttributeHolder::operator-> ( ) const
inline

Const arrow operator, invalid to use if this holder refers to a null attribute.

Definition at line 291 of file PDG_AttributeHolder.h.

PDG_AttributeData* PDG_AttributeHolder::operator-> ( )
inline

Nonconst arrow operator, invalid to use if this holder refers to a null attribute.

Definition at line 298 of file PDG_AttributeHolder.h.

PDG_AttributeHolder& PDG_AttributeHolder::operator= ( PDG_AttributeHolder &&  other)
inline

Move assignment is permitted.

Definition at line 83 of file PDG_AttributeHolder.h.

bool PDG_AttributeHolder::operator== ( const PDG_AttributeHolder other) const
inline

Compares two attribute holders and returns true if they're the same. The data is only compared if all other aspects are the same.

Definition at line 319 of file PDG_AttributeHolder.h.

PDG_AttributeData* PDG_AttributeHolder::own ( )
inline

Takes ownership of the attribute pointer if it is not already owned. If it is, the pointer is returned back directly

Definition at line 139 of file PDG_AttributeHolder.h.

void PDG_AttributeHolder::reset ( void  )
inline

Resets the holder to a nullptr, thus making it an invalid holder.

Definition at line 169 of file PDG_AttributeHolder.h.

PDG_AttributeData* PDG_AttributeHolder::reset ( const PDG_AttributeData attribute,
PDG_AttributeType  type,
uint16  flags,
bool  own,
bool  stale,
bool  concat 
)
inline

Changes the attribute owned by this holder, and deletes the existing attribute if one existed and was owned by this holder.

Definition at line 183 of file PDG_AttributeHolder.h.

PDG_AttributeData* PDG_AttributeHolder::reset ( const PDG_AttributeHolder holder,
bool  own,
bool  sync_flags 
)
inline

Changes the attribute owned by this holder so that it has a shallow holder to the one owned by the specififed attribute, or copies it depending on the own arg. Deletes the existing attribute if one existed and was owned by this holder

Definition at line 221 of file PDG_AttributeHolder.h.

bool PDG_AttributeHolder::setFlag ( PDG_AttributeFlag  flag,
bool  set 
)
inline

Sets a flag on the attribute. Returns true if the flag was changed as a result of this operation.

Definition at line 398 of file PDG_AttributeHolder.h.

bool PDG_AttributeHolder::setFlags ( uint16  flags)
inline

Sets the flags on the attribute directly. Returns true if any of the flags were modified.

Definition at line 421 of file PDG_AttributeHolder.h.

void PDG_AttributeHolder::setIsChanged ( bool  is_changed)
inline

Sets the changed bit to the specified value.

Definition at line 437 of file PDG_AttributeHolder.h.

void PDG_AttributeHolder::setIsConcat ( bool  is_concat)
inline

Sets the concat bit to the specified value.

Definition at line 431 of file PDG_AttributeHolder.h.

template<typename Attribute >
void PDG_AttributeHolder::swap ( PDG_AttributeHolder other)
inline

Swaps the specified attribute with the attribute in this holder.

Definition at line 466 of file PDG_AttributeHolder.h.

void PDG_AttributeHolder::swapAttributes ( PDG_AttributeHolder holder)
inline

Swaps the attributes in this holder and the specified holder, but leaves the flags unmodified.

Definition at line 151 of file PDG_AttributeHolder.h.

PDG_AttributeType PDG_AttributeHolder::type ( ) const
inline

Returns the attribute type.

Definition at line 361 of file PDG_AttributeHolder.h.

template<typename Attribute >
bool PDG_AttributeHolder::typeMatch ( ) const
inline

Returns true if the type of the template argumented is a match for the the type of this holder

Definition at line 354 of file PDG_AttributeHolder.h.


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