pvAccessCPP
7.1.9
Toggle main menu visibility
Loading...
Searching...
No Matches
server
pv
serverContext.h
1
6
7
#ifndef SERVERCONTEXT_H_
8
#define SERVERCONTEXT_H_
9
10
#include <epicsTime.h>
11
12
#include <pv/pvaDefs.h>
13
#include <pv/beaconServerStatusProvider.h>
14
#include <pv/pvaConstants.h>
15
#include <pv/pvaVersion.h>
16
#include <pv/pvAccess.h>
17
#include <pv/configuration.h>
18
19
#include <shareLib.h>
20
21
namespace
epics
{
22
namespace
pvAccess
{
23
27
class
epicsShareClass
ServerContext
28
{
29
public
:
30
POINTER_DEFINITIONS(
ServerContext
);
31
35
virtual
~ServerContext
() {};
36
41
virtual
const
ServerGUID
&
getGUID
() = 0;
42
47
virtual
const
Version&
getVersion
() = 0;
48
55
virtual
void
run
(
epics::pvData::uint32
seconds
) = 0;
56
57
virtual
void
shutdown() = 0;
58
62
void
printInfo
(
int
lvl =0);
63
69
virtual
void
printInfo
(
std::ostream
& str,
int
lvl=0) = 0;
70
71
virtual
epicsTimeStamp& getStartTime() = 0;
72
77
virtual
epics::pvData::int32
getServerPort
() = 0;
78
83
virtual
epics::pvData::int32
getBroadcastPort
() = 0;
84
88
virtual
Configuration::shared_pointer
getCurrentConfig
() = 0;
89
90
virtual
const
std::vector<ChannelProvider::shared_pointer>
& getChannelProviders() =0;
91
92
// ************************************************************************** //
93
// **************************** [ Plugins ] ********************************* //
94
// ************************************************************************** //
95
100
virtual
void
setBeaconServerStatusProvider
(BeaconServerStatusProvider::shared_pointer
const
& beaconServerStatusProvider) = 0;
101
103
class
Config {
104
friend
class
ServerContext;
105
Configuration::const_shared_pointer _conf;
106
std::vector<ChannelProvider::shared_pointer>
_providers;
107
public
:
108
Config() {}
110
Config&
config
(
const
Configuration::const_shared_pointer& c) { _conf = c;
return
*
this
; }
112
Config&
providers
(
const
std::vector<ChannelProvider::shared_pointer>
& p) { _providers = p;
return
*
this
; }
114
Config&
provider
(
const
ChannelProvider::shared_pointer& p) { _providers.push_back(p);
return
*
this
; }
115
};
116
130
static
ServerContext::shared_pointer
create
(
const
Config
& conf =
Config
());
131
};
132
133
// Caller must store the returned pointer to keep the server alive.
134
epicsShareFunc ServerContext::shared_pointer startPVAServer(
135
std::string
const
& providerNames =
PVACCESS_ALL_PROVIDERS
,
136
int
timeToRun = 0,
137
bool
runInSeparateThread =
false
,
138
bool
printInfo =
false
);
139
140
}
141
}
142
143
144
#endif
/* SERVERCONTEXT_H_ */
seconds
duration< int64_t > seconds
std::ostream
basic_ostream< char > ostream
std::string
basic_string< char > string
std::vector
epics::pvAccess::ServerContext::Config
Options for a server insatnce.
Definition
serverContext.h:103
epics::pvAccess::ServerContext::Config::providers
Config & providers(const std::vector< ChannelProvider::shared_pointer > &p)
Attach many providers.
Definition
serverContext.h:112
epics::pvAccess::ServerContext::Config::config
Config & config(const Configuration::const_shared_pointer &c)
Use specific configuration. Default is process environment.
Definition
serverContext.h:110
epics::pvAccess::ServerContext::Config::provider
Config & provider(const ChannelProvider::shared_pointer &p)
short hand for providers() with a length 1 vector.
Definition
serverContext.h:114
epics::pvAccess::ServerContext
The class representing a PVA Server context.
Definition
serverContext.h:28
epics::pvAccess::ServerContext::run
virtual void run(epics::pvData::uint32 seconds)=0
Run server (process events).
epics::pvAccess::ServerContext::getBroadcastPort
virtual epics::pvData::int32 getBroadcastPort()=0
Get broadcast port.
epics::pvAccess::ServerContext::getGUID
virtual const ServerGUID & getGUID()=0
Returns GUID (12-byte array).
epics::pvAccess::ServerContext::getServerPort
virtual epics::pvData::int32 getServerPort()=0
Get server port.
epics::pvAccess::ServerContext::printInfo
virtual void printInfo(std::ostream &str, int lvl=0)=0
Prints detailed information about the context to the specified output stream.
epics::pvAccess::ServerContext::getVersion
virtual const Version & getVersion()=0
Get context implementation version.
epics::pvAccess::ServerContext::~ServerContext
virtual ~ServerContext()
Destructor.
Definition
serverContext.h:35
epics::pvAccess::ServerContext::create
static ServerContext::shared_pointer create(const Config &conf=Config())
Start a new PVA server.
epics::pvAccess::ServerContext::setBeaconServerStatusProvider
virtual void setBeaconServerStatusProvider(BeaconServerStatusProvider::shared_pointer const &beaconServerStatusProvider)=0
Set beacon server status provider.
epics::pvAccess::ServerContext::printInfo
void printInfo(int lvl=0)
Prints detailed information about the context to the standard output stream.
epics::pvAccess::ServerContext::getCurrentConfig
virtual Configuration::shared_pointer getCurrentConfig()=0
Return a Configuration with the actual values being used, including defaults used,...
epics::pvAccess
Holds all PVA related.
Definition
monitor.h:37
epics::pvAccess::PVACCESS_ALL_PROVIDERS
const std::string PVACCESS_ALL_PROVIDERS
"All-providers registered" PVA provider name.
epics::pvData::uint32
uint32_t uint32
epics::pvData::int32
int32_t int32
epics
Copyright - See the COPYRIGHT that is included with this distribution.
epics::pvAccess::ServerGUID
Globally unique ID.
Definition
pvaDefs.h:14
Generated on
for pvAccessCPP by
1.17.0