HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
UN_PortTypeRegistry.h
Go to the documentation of this file.
1 /*
2  * PROPRIETARY INFORMATION. This software is proprietary to
3  * Side Effects Software Inc., and is not to be reproduced,
4  * transmitted, or disclosed in any way without written permission.
5  *
6  * NAME: UN_PortTypeRegistry.h ( UN Library, C++)
7  *
8  * COMMENTS:
9  *
10  */
11 
12 #ifndef __UN_PortTypeRegistry_h__
13 #define __UN_PortTypeRegistry_h__
14 
15 #include "UN_API.h"
16 #include "UN_PortType.h"
17 #include "UN_TypeRegistry.h"
18 #include "UN_Utils.h"
19 
20 
21 // ============================================================================
22 /// A registry that maintains the set of port types.
23 ///
24 class UN_API UN_PortTypeRegistry : public UN_TypeRegistry< UN_PortType >
25 {
26 public:
29 
30  /// @{ Constructor and destructor
32  /// @}
33 
34  /// A set of additional characters that are legal in port type names.
35  void setPortTypeNameSafeChars( const UT_StringRef &safe_chars )
36  {
37  myPortTypeNameSafeChars = safe_chars;
38  }
39 
40  /// Returns true if the given port type name is valid in this category.
41  bool isValidTypeName( const UT_StringRef &port_type_name ) const
42  {
43  return UN_Utils::isValidPortTypeName(
44  port_type_name, myPortTypeNameSafeChars );
45  }
46 
47  /// Adds the given port type to the reigstry.
48  bool addType( UN_PortTypeHandle port_type );
49 
50 private:
51  /// Extra characters that are legal in the port type names.
52  /// Eg, Usd uses "[]" in type names to indicate arrays.
53  UT_StringHolder myPortTypeNameSafeChars;
54 };
55 
56 
57 #endif
58 
void setPortTypeNameSafeChars(const UT_StringRef &safe_chars)
A set of additional characters that are legal in port type names.
#define UN_API
Definition: UN_API.h:11
std::unique_ptr< T, Deleter > UT_UniquePtr
A smart pointer for unique ownership of dynamically allocated objects.
Definition: UT_UniquePtr.h:39
UT_UniquePtr< UN_PortType > PortTypeHandle
bool isValidTypeName(const UT_StringRef &port_type_name) const
Returns true if the given port type name is valid in this category.
bool addType(TypeHandle type_handle)
UT_UniquePtr< UN_PortType > UN_PortTypeHandle
A handle to the port type object, for expressing the ownership.
Definition: UN_PortType.h:58