Loading...
Searching...
No Matches
Ef_VectorKey Class Referenceabstract

This class wraps a VdfVector adding equality comparison and hashing capabilities to the vector, without requiring all types stored in VdfVector to implement the corresponding operators. More...

#include <vectorKey.h>

+ Inheritance diagram for Ef_VectorKey:

Classes

struct  Equal
 Equality compare functor. More...
 
struct  Map
 Type of a hash map with Ef_VectorKey as key. More...
 

Public Types

using StoredType = std::shared_ptr< Ef_VectorKey >
 The type which must be used to store Ef_VectorKeys, for example as keys in a hash map.
 

Public Member Functions

 Ef_VectorKey (const Ef_VectorKey &)=delete
 Non-copyable.
 
Ef_VectorKeyoperator= (const Ef_VectorKey &)=delete
 
virtual EF_API ~Ef_VectorKey ()
 Destructor.
 
const VdfVectorGetValue () const
 Returns the wrapped VdfVector.
 
virtual size_t CreateHash () const =0
 Generates a hash from the VdfVector.
 
virtual bool IsEqual (const Ef_VectorKey &) const =0
 Equality compares this Ef_VectorKey with another one.
 
bool operator== (const Ef_VectorKey &rhs) const
 Equality operator.
 
bool operator!= (const Ef_VectorKey &rhs) const
 

Protected Member Functions

 Ef_VectorKey (const VdfVector &value)
 

Protected Attributes

const VdfVector _value
 

Friends

template<class HashState >
void TfHashAppend (HashState &h, const Ef_VectorKey::StoredType &v)
 Hashing.
 

Detailed Description

This class wraps a VdfVector adding equality comparison and hashing capabilities to the vector, without requiring all types stored in VdfVector to implement the corresponding operators.

Only the types wrapped in Ef_VectorKey must provide these operators.

This is an abstract base class.

Definition at line 35 of file vectorKey.h.


Class Documentation

◆ Ef_VectorKey::Map

struct Ef_VectorKey::Map
template<typename T>
struct Ef_VectorKey::Map< T >

Type of a hash map with Ef_VectorKey as key.

Definition at line 99 of file vectorKey.h.

Class Members
typedef TfHashMap< StoredType, T, TfHash, Equal > Type

Member Typedef Documentation

◆ StoredType

using StoredType = std::shared_ptr<Ef_VectorKey>

The type which must be used to store Ef_VectorKeys, for example as keys in a hash map.

Definition at line 41 of file vectorKey.h.

Constructor & Destructor Documentation

◆ Ef_VectorKey() [1/2]

Ef_VectorKey ( const Ef_VectorKey )
delete

Non-copyable.

◆ ~Ef_VectorKey()

virtual EF_API ~Ef_VectorKey ( )
virtual

Destructor.

◆ Ef_VectorKey() [2/2]

Ef_VectorKey ( const VdfVector value)
inlineexplicitprotected

Definition at line 106 of file vectorKey.h.

Member Function Documentation

◆ CreateHash()

virtual size_t CreateHash ( ) const
pure virtual

Generates a hash from the VdfVector.

This must be implemented by the derived Ef_TypedVectorKey.

Implemented in Ef_TypedVectorKey< T >.

◆ GetValue()

const VdfVector & GetValue ( ) const
inline

Returns the wrapped VdfVector.

Definition at line 55 of file vectorKey.h.

◆ IsEqual()

virtual bool IsEqual ( const Ef_VectorKey ) const
pure virtual

Equality compares this Ef_VectorKey with another one.

This must be implemented by the derived Ef_TypedVectorKey.

Implemented in Ef_TypedVectorKey< T >.

◆ operator!=()

bool operator!= ( const Ef_VectorKey rhs) const
inline

Definition at line 77 of file vectorKey.h.

◆ operator==()

bool operator== ( const Ef_VectorKey rhs) const
inline

Equality operator.

Definition at line 73 of file vectorKey.h.

Friends And Related Function Documentation

◆ TfHashAppend

void TfHashAppend ( HashState &  h,
const Ef_VectorKey::StoredType v 
)
friend

Hashing.

Definition at line 84 of file vectorKey.h.

Member Data Documentation

◆ _value

const VdfVector _value
protected

Definition at line 111 of file vectorKey.h.


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