HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
UN_GraphContext.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_GraphContext.h ( UN Library, C++)
7  *
8  * COMMENTS:
9  *
10  */
11 
12 #ifndef __UN_GraphContext_h__
13 #define __UN_GraphContext_h__
14 
15 #include "UN_API.h"
16 #include "UN_GraphConfig.h"
17 #include <UT/UT_StringArray.h>
18 
19 class UN_UniCategory;
20 class UNI_Manager;
21 
22 // ============================================================================
23 /// The graph context class, representing a specific use case for the graph.
24 /// It provides specific values for the configurable behaviours of the graph,
25 /// like alphanumeric validity and uniqueness of the nodes in the graph,
26 /// and also supplies the graph with concrete node and data types to operate on.
27 
29 {
30 public:
31  /// @{ Constructor and destructor
32  /// @param graph_config Object that describes the graph's capabilities.
33  /// @param root_type_name The node type name that should be used for the
34  /// root node of this graph.
35  /// @param manager Object that manages types.
36  /// If given, it should outlive the context.
38  const UT_StringHolder &root_type_name = UT_StringHolder(),
39  UNI_Manager *manager = nullptr);
40  /// @}
41 
42  /// Comparison operator.
43  bool operator==( const UN_GraphContext &other ) const;
44 
45  /// Returns the node type to be used for the root of this graph.
46  const UT_StringHolder & rootTypeName() const
47  { return myRootTypeName; }
48 
49  /// Returns the configuration options for the graph in this context.
50  const UN_GraphConfig & graphConfig() const
51  { return myGraphConfig; }
52 
53  /// Returns the configuration options for the graph in this context.
54  const UNI_Manager * manager() const
55  { return myManager; }
56 
57 private:
58  /// Graph configuration settings.
59  UN_GraphConfig myGraphConfig;
60 
61  /// The name of the node type for the root node (from the UNI_Manager's
62  /// UNI_ROOT_CATEGORY node type category).
63  UT_StringHolder myRootTypeName;
64 
65  /// Manager of node type categories.
66  UNI_Manager *myManager;
67 };
68 
69 
70 #endif
71 
const UN_GraphConfig & graphConfig() const
Returns the configuration options for the graph in this context.
#define UN_API
Definition: UN_API.h:11
bool operator==(const BaseDimensions< T > &a, const BaseDimensions< Y > &b)
Definition: Dimensions.h:137
const UNI_Manager * manager() const
Returns the configuration options for the graph in this context.
const UT_StringHolder & rootTypeName() const
Returns the node type to be used for the root of this graph.