HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PDG_ServiceTypes.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  * COMMENTS:
7  */
8 
9 #ifndef __PDG_SERVICE_TYPES_H__
10 #define __PDG_SERVICE_TYPES_H__
11 
12 #include <UT/UT_Array.h>
13 #include <UT/UT_SharedPtr.h>
14 #include <UT/UT_UniquePtr.h>
15 
16 class PDG_Service;
17 class PDG_ServiceClient;
18 
19 /// Type def for registered type objects
21 
22 /// Type def for service clients
25 
26 /// Enumeration of service block cook modes
28 {
29  /// Work items will never cook using the service associated with the
30  /// parent block
31  eNever,
32 
33  /// Work items will cook the parent block's service if it matches the
34  /// service name for the node
35  eMatch,
36 
37  /// Work items will always use the parent block's service
38  eAlways,
39 };
40 
41 /// When service clients should be reset
43 {
44  /// The service client is not reset
45  eNone = 0x0,
46 
47  /// The service client is reset at the start of a work item or block cook
48  eBeforeCook = 0x1,
49 
50  /// The service client is reset at the end of a work item or block cook
51  eAfterCook = 0x2,
52 
53  /// The service is reset at the beginning and end of a cook
54  eBoth = 0x3
55 };
56 
57 /// Service client reset operation, performed each time work items acquire a
58 /// new client.
60 {
61  /// The service client is not reset
62  eNone,
63 
64  /// The service client is sent the "reset" command
65  eReset,
66 
67  /// The service client process is restarted
68  eRestart
69 };
70 
71 /// Enumeration of the different types of service owner
72 enum class PDG_ServiceOwner
73 {
74  /// The service is owned by a scheduler, which means it will be tied to
75  /// the lifetime of the scheduler node(s).
76  eScheduler,
77 
78  /// The service is owned by the session, which means it will be stopped
79  /// only if stopped by the user or Houdini is closed.
80  eSession
81 };
82 
83 /// Enumeration of the different types of scheduler services, which determines
84 /// how the scheduler is found
86 {
87  /// The default scheduler for the graph is used to run service clients
88  eDefault,
89 
90  /// The first scheduler of a specified scheduler type is used to run
91  /// service clients
92  eFirstType,
93 
94  /// A specific scheduler is used to run service clients
95  eInstance
96 };
97 
98 /// Enumeration of the different states that a service can be in
99 enum class PDG_ServiceState
100 {
101  // The service is not running
102  eStopped,
103 
104  // The service is in the process of stopping. The service will remain in
105  // this state until the MQ Server and all of the service clients have
106  // been issued a command to shutdown.
107  eStopping,
108 
109  // The service is in the process of starting. The service will remain in
110  // this state until all of the service clients have fully started up.
111  eStarting,
112 
113  // The service is fully running and all clients are available.
114  eRunning,
115 
116  // The service is in an unrecoverable error state
117  eError
118 };
119 
120 /// Enumeration of service log types
122 {
123  /// The service does not do any logging -- stdout is routed to
124  /// /dev/null
125  eNone,
126 
127  /// The service logs to stdout
128  eStdout,
129 
130  /// The service logs to a file on disk
131  eFile
132 };
133 
134 /// Enumeration of possible result values from starting a service
136 {
137  /// An error occured and the service was not started
138  eError,
139 
140  /// The service was successfully started
141  eSuccess,
142 
143  /// The service was already running
144  eRunning,
145 
146  /// The service clients are connecting in the background
148 };
149 
150 /// Enumeration of return codes when acquiring a service client
152 {
153  /// A service client was successfully acquired
154  eSuccess,
155 
156  /// A service client was successfully acquired and locked
158 
159  /// All service workers are already busy
160  eBusy,
161 
162  /// The service worker is aleady in use by a different task
163  /// with the same service lock id
164  eLocked,
165 
166  /// The service lock is invalid -- should never occur in practice
167  eInvalidLock,
168 
169  /// The service has no available clients, typically due to some
170  /// kind of fatal error during start-up
172 };
173 
174 #endif /* __PDG_SERVICE_TYPES_H__ */
Only overwrite the attribute if the type matches.
The service lock is invalid – should never occur in practice.
PDG_ServiceResetType
The service logs to stdout.
Never overwrite the attribute.
UT_SharedPtr< PDG_Service > PDG_ServicePtr
Type def for registered type objects.
The service client is reset at the start of a work item or block cook.
PDG_ServiceAcquireResult
Enumeration of return codes when acquiring a service client.
All service workers are already busy.
std::unique_ptr< T, Deleter > UT_UniquePtr
A smart pointer for unique ownership of dynamically allocated objects.
Definition: UT_UniquePtr.h:39
The service is reset at the beginning and end of a cook.
The service clients are connecting in the background.
No error was specified, i.e. the ref is valid.
UT_UniquePtr< PDG_ServiceClient > PDG_ServiceClientPtr
Type def for service clients.
std::shared_ptr< T > UT_SharedPtr
Wrapper around std::shared_ptr.
Definition: UT_SharedPtr.h:36
A service client was successfully acquired and locked.
PDG_ServiceResetWhen
When service clients should be reset.
The service client is reset at the end of a work item or block cook.
Default display type.
The service client process is restarted.
PDG_ServiceLogType
Enumeration of service log types.
PDG_ServiceOwner
Enumeration of the different types of service owner.
PDG_ServiceStartResult
Enumeration of possible result values from starting a service.
No cast error occured (success)
PDG_ServiceState
Enumeration of the different states that a service can be in.
The service client is sent the "reset" command.
A specific scheduler is used to run service clients.
PDG_ServiceSchedulerType
The service logs to a file on disk.
PDG_ServiceBlockCookType
Enumeration of service block cook modes.