HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
UN_TypeRegistry< Type > Class Template Reference

#include <UN_TypeRegistry.h>

Classes

class  TypeIterator
 Iterator for traversing registered types as const Type references. More...
 

Public Types

using TypeHandle = UT_UniquePtr< Type >
 Defining a handle to express ownership management. More...
 
using TypeRange = UT_IteratorRange< TypeIterator >
 Returns an iterator range over the registered types. More...
 

Public Member Functions

const UT_StringArraytypeNames () const
 Returns the list of the type names in this registry. More...
 
TypeRange typeRange () const
 
const Type * findType (const UT_StringRef &type_name) const
 Returns a type by the given name, or null if not found. More...
 
 UN_TypeRegistry ()=default
 Constructor and destructor. More...
 
 ~UN_TypeRegistry ()=default
 Constructor and destructor. More...
 

Protected Member Functions

bool addType (TypeHandle type_handle)
 
bool removeType (const UT_StringRef &node_type_name)
 

Detailed Description

template<typename Type>
class UN_TypeRegistry< Type >

A registry that maintains the set of types.

Definition at line 26 of file UN_TypeRegistry.h.

Member Typedef Documentation

template<typename Type>
using UN_TypeRegistry< Type >::TypeHandle = UT_UniquePtr<Type>

Defining a handle to express ownership management.

Definition at line 30 of file UN_TypeRegistry.h.

template<typename Type>
using UN_TypeRegistry< Type >::TypeRange = UT_IteratorRange< TypeIterator >

Returns an iterator range over the registered types.

Definition at line 58 of file UN_TypeRegistry.h.

Constructor & Destructor Documentation

template<typename Type>
UN_TypeRegistry< Type >::UN_TypeRegistry ( )
default

Constructor and destructor.

template<typename Type>
UN_TypeRegistry< Type >::~UN_TypeRegistry ( )
default

Constructor and destructor.

Member Function Documentation

template<typename Type>
bool UN_TypeRegistry< Type >::addType ( TypeHandle  type_handle)
inlineprotected

Adds the given type to the reigstry. Returns true on success, and false when the type could not be added (eg, due to name conflicts with other types, etc).

Definition at line 78 of file UN_TypeRegistry.h.

template<typename Type>
const Type* UN_TypeRegistry< Type >::findType ( const UT_StringRef type_name) const
inline

Returns a type by the given name, or null if not found.

Definition at line 67 of file UN_TypeRegistry.h.

template<typename Type>
bool UN_TypeRegistry< Type >::removeType ( const UT_StringRef node_type_name)
inlineprotected

Removes the given type from the registry. Returns true if the type was removed from the registry; false otherwise.

Definition at line 98 of file UN_TypeRegistry.h.

template<typename Type>
const UT_StringArray& UN_TypeRegistry< Type >::typeNames ( ) const
inline

Returns the list of the type names in this registry.

Definition at line 41 of file UN_TypeRegistry.h.

template<typename Type>
TypeRange UN_TypeRegistry< Type >::typeRange ( ) const
inline

Definition at line 60 of file UN_TypeRegistry.h.


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