FesaDefs.h

Go to the documentation of this file.
00001 // Copyright CERN 2012 - Developed in collaboration with GSI
00002 
00003 #ifndef FESA_DEFS_H_
00004 #define FESA_DEFS_H_
00005 
00006 #include <string>
00007 #include <signal.h>
00008 
00009 #include <stdint.h>
00010 
00011 namespace fesa
00012 {
00013 
00014 const int32_t DEFAULT_RT_PRIO_DIAGNOSTIC_LAYER = 5;
00015 const int32_t DEFAULT_RT_PRIO_PERSISTANCE_THREAD = 25;
00016 const int32_t DEFAULT_RT_PRIO_CLIENT_NOTIFICATION_THREAD = 25;
00017 const int32_t DEFAULT_RT_PRIO_SIGNAL_HANDLER_THREAD = 25;
00018 
00019 //DEFAULT_PRIO_SERVER_NOTIF_THREAD > PRIO_CLIENT_NOTIFICATION_THREAD for all client notif threads
00020 const int32_t DEFAULT_RT_PRIO_SERVER_NOTIF_THREAD = 26;
00021 
00022 //DEFAULT_PRIO_RDA_SERVER_THREAD > DEFAULT_PRIO_SERVER_NOTIF_THREAD
00023 const int32_t DEFAULT_RT_PRIO_RDA_SERVER_THREAD = 27;
00024 
00025 const int32_t DEFAULT_RT_PRIO_CONCURRENCY_LAYER = 50;
00026 const int32_t DEFAULT_RT_PRIO_EVENT_SOURCE = 51;
00027 
00028 const int32_t DEFAULT_NICE_PRIO_DIAGNOSTIC_LAYER = 17;
00029 const int32_t DEFAULT_NICE_PRIO_PERSISTANCE_THREAD = 15;
00030 const int32_t DEFAULT_NICE_PRIO_CLIENT_NOTIFICATION_THREAD = 15;
00031 const int32_t DEFAULT_NICE_PRIO_SIGNAL_HANDLER_THREAD = 15;
00032 
00033 //DEFAULT_PRIO_SERVER_NOTIF_THREAD > PRIO_CLIENT_NOTIFICATION_THREAD for all client notif threads
00034 const int32_t DEFAULT_NICE_PRIO_SERVER_NOTIF_THREAD = 10;
00035 
00036 //DEFAULT_PRIO_RDA_SERVER_THREAD > DEFAULT_PRIO_SERVER_NOTIF_THREAD
00037 const int32_t DEFAULT_NICE_PRIO_RDA_SERVER_THREAD = 8;
00038 
00039 const int32_t DEFAULT_NICE_PRIO_CONCURRENCY_LAYER = 5;
00040 const int32_t DEFAULT_NICE_PRIO_EVENT_SOURCE = 3;
00041 
00045 const uint32_t FEC_NAME_LENGTH = 31;
00046 
00050 const uint32_t CLASS_NAME_LENGTH = 31;
00051 
00055 const uint32_t MUXCONTEXT_NAME_LENGTH = 31;
00056 
00060 const uint32_t CLASS_VERSION_LENGTH = 31;
00061 
00065 const uint32_t CLASS_DESC_LENGTH = 63;
00066 
00070 const uint32_t DEVICE_NAME_LENGTH = 31;
00071 
00075 const uint32_t DEVICE_DESC_LENGTH = 63;
00076 
00080 const uint32_t FIELD_STRING_LENGTH = 15;
00081 
00085 const uint32_t FIELD_NAME_LENGTH = 15;
00086 
00090 const uint32_t PROPERTY_NAME_LENGTH = 31;
00091 
00095 const uint32_t DIAG_TRACE_DEVICE_LENGTH = 320;
00096 
00100 const uint32_t DIAG_BYPASS_ACTION_LENGTH = 320;
00101 
00105 const uint32_t HW_MODULE_TYPE_LENGTH = 31;
00106 
00110 enum DataIntegrity
00111 {
00112     SingleBuffered = 1, DoubleBuffered = 2
00113 };
00114 
00118 enum FieldCategory
00119 {
00120     Configuration, Setting, Acquisition, Generic
00121 };
00122 
00126 const uint32_t NO_NOTIFICATION = 0;
00127 
00131 const int32_t NO_TIMING_SELECTOR = -1;
00132 
00136 const uint32_t COMMAND_STRING_MAXSIZE = 100;
00137 
00141 const uint32_t DIAG_HOST_NAME_LENGTH = 31;
00142 
00146 struct DiagnosticEventPayload
00147 {
00148     char hostName_[DIAG_HOST_NAME_LENGTH];
00149     int32_t port_;
00150     char className_[CLASS_NAME_LENGTH];
00151     uint32_t state_;
00152     double tsCounterPeriod_;
00153     int32_t fwkTopic_;
00154     int32_t customTopic_;
00155 };
00156 
00157 /* 5 types of event-source are supported (defined by type/name/key):
00158  * hardware/timer/""                    one source only (no key)
00159  * hardware/timing|timingSim/""         one source only (no key)
00160  * on-demand/onDemand/""                one source only (no key)
00161  * on-subscription/onSubscription/""    one source only (no key)
00162  * custom/<name>/<key>                  multiple sources allowed
00163  *
00164  * Notes:
00165  * . <name> are unique, they are defined by the user in the design document.
00166  * . <key> is a string which is required for dynamic instantiation of the
00167  *   custom-event-source which supports multiple occurrences.
00168  */
00169 
00173 const std::string TIMER_EVENT_SOURCE_NAME = "Timer";
00174 
00178 const std::string TIMING_EVENT_SOURCE_NAME = "Timing";
00179 
00183 const std::string ON_DEMAND_EVENT_SOURCE_NAME = "OnDemand";
00184 
00185 /*
00186  * \brief fixed name of the on-subscription event source
00187  */
00188 const std::string ON_SUBSCRIPTION_EVENT_SOURCE_NAME = "OnSubscription";
00189 
00193 const std::string DEFAULT_EVENT_SOURCE_KEY = "default-source";
00194 
00198 const std::string EXTRA_CRITERION_NAME = "ExtraCriterion";
00199 
00203 const std::string DIAGNOSTIC_LAYER = "diagnosticLayer";
00204 
00208 const uint32_t MaxLength = 20;
00209 
00213 enum FesaProcessType
00214 {
00215     splitServerOnly,    // Only a Server-process exists for this binary
00216     splitRealTimeOnly,  // Only a RT-process exists for this binary
00217     splitServerMixed,   // Server- and RT-process both exist on the FEC, this binary is the Server-Process
00218     splitRealTimeMixed, // Server- and RT-process both exist on the FEC, this binary is the RT-Process
00219     unsplit             // Server and RT part are running in the same process
00220 };
00221 
00225 enum RunMode
00226 {
00227         blocking,
00228         nonBlocking
00229 };
00230 
00234 const std::string OD_MQ_Prefix = "/OD_MQ_";
00235 
00239 const uint32_t OD_MSG_SIZE_MAX = 1024;
00240 
00244 const uint32_t OD_MSG_NUM_MAX = 10;
00245 
00257 enum RequestType //merged with NOTIFICATION_UPDATE_FLAGS
00258 {
00259     GET = 0, SUBSCRIBE = 1, SET = 2
00260 };
00261 
00265 enum IOType
00266 {
00267     Input = 0, Output = 1
00268 };
00269 
00273 enum PropertyType
00274 {
00275     SETTING = 0, ACQUISITION = 1
00276 };
00277 
00278 
00282 const int32_t SIGFESA_NOTIFICATION_FAILURE = SIGRTMIN + 4; // +4 to avoid conflicts with Linux Thread library signals
00283 const int32_t SIGFESA_RT_DOWN = SIGRTMIN + 5;
00284 const int32_t SIGFESA_CHECK_PROCESS_ALIVE = SIGRTMIN + 6;
00285 
00286 } // fesa
00287 
00288 #endif // FESA_DEFS_H_

Generated on 18 Jan 2013 for Fesa by  doxygen 1.6.1