Project
Loading...
Searching...
No Matches
PrimaryServerState.h
Go to the documentation of this file.
1// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
2// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3// All rights not expressly granted are reserved.
4//
5// This software is distributed under the terms of the GNU General Public
6// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7//
8// In applying this license CERN does not waive the privileges and immunities
9// granted to it by virtue of its status as an Intergovernmental Organization
10// or submit itself to any jurisdiction.
11
12#ifndef O2_PRIMARYSERVERSTATE_H
13#define O2_PRIMARYSERVERSTATE_H
14
15#include <TMessage.h>
16#include <fairmq/FwdDecls.h>
17
18namespace o2
19{
20
23 Initializing = 0,
24 ReadyToServe = 1,
25 WaitingEvent = 2,
26 Idle = 3,
27 Stopped = 4
28};
29inline constexpr const char* PrimStateToString[5] = {"INIT", "SERVING", "WAITEVENT", "IDLE", "STOPPED"};
30
33 Status = 1, // asks to retrieve current status of O2PrimaryServerDevice --> will send O2PrimaryServerState
34 Config = 2, // asks for o2-sim config reply
35 AllowShutdown = 3 // can be used to let particle server know that shutdown is now safe (once all components initialized)
36};
37
41 int workerid = -1;
42 int workerpid = -1;
43 int requestid = -1;
44};
45
50 bool payload_attached; // whether real payload follows (or server has no work at this moment)
51};
52
55{
56 public:
57 TMessageWrapper(void* buf, Int_t len) : TMessage(buf, len) { ResetBit(kIsOwner); }
58 ~TMessageWrapper() override = default;
59};
60
63bool querySimConfig(fair::mq::Channel& channel);
64
65} // namespace o2
66
67#endif //O2_PRIMARYSERVERSTATE_H
A TMessage reading from a buffer it does not own.
TMessageWrapper(void *buf, Int_t len)
~TMessageWrapper() override=default
GLenum GLenum GLsizei len
Definition glcorearb.h:4232
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition glcorearb.h:2514
@ Idle
End of streaming notified.
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
bool querySimConfig(fair::mq::Channel &channel)
O2PrimaryServerInfoRequest
enum class for request to o2sim-primserv-info channel of the O2PrimaryServerDevice
constexpr const char * PrimStateToString[5]
O2PrimaryServerState
enum to represent state of the O2Sim event/primary server
O2PrimaryServerState serverstate