7 #ifndef SERVERCONTEXT_H_
8 #define SERVERCONTEXT_H_
10 #include <epicsTime.h>
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>
47 virtual const Version& getVersion() = 0;
55 virtual void run(epics::pvData::uint32
seconds) = 0;
57 virtual void shutdown() = 0;
62 void printInfo(
int lvl =0);
69 virtual void printInfo(
std::ostream& str,
int lvl=0) = 0;
71 virtual epicsTimeStamp& getStartTime() = 0;
77 virtual epics::pvData::int32 getServerPort() = 0;
83 virtual epics::pvData::int32 getBroadcastPort() = 0;
88 virtual Configuration::shared_pointer getCurrentConfig() = 0;
100 virtual void setBeaconServerStatusProvider(BeaconServerStatusProvider::shared_pointer
const & beaconServerStatusProvider) = 0;
105 Configuration::const_shared_pointer _conf;
110 Config&
config(
const Configuration::const_shared_pointer& c) { _conf = c;
return *
this; }
114 Config&
provider(
const ChannelProvider::shared_pointer& p) { _providers.push_back(p);
return *
this; }
130 static ServerContext::shared_pointer create(
const Config& conf = Config());
134 epicsShareFunc ServerContext::shared_pointer startPVAServer(
137 bool runInSeparateThread =
false,
138 bool printInfo =
false);
duration< int64_t > seconds
Config & config(const Configuration::const_shared_pointer &c)
Use specific configuration. Default is process environment.
Options for a server insatnce.
const std::string PVACCESS_ALL_PROVIDERS
"All-providers registered" PVA provider name.
virtual ~ServerContext()
Destructor.
Config & provider(const ChannelProvider::shared_pointer &p)
short hand for providers() with a length 1 vector.
Config & providers(const std::vector< ChannelProvider::shared_pointer > &p)
Attach many providers.
The class representing a PVA Server context.