71 lines
1.6 KiB
C++
71 lines
1.6 KiB
C++
/**
|
|
* Copyright - See the COPYRIGHT that is included with this distribution.
|
|
* pvAccessCPP is distributed subject to a Software License Agreement found
|
|
* in file LICENSE that is included with this distribution.
|
|
*/
|
|
|
|
#ifndef RPCSERVER_H
|
|
#define RPCSERVER_H
|
|
|
|
#ifdef epicsExportSharedSymbols
|
|
# define rpcServerEpicsExportSharedSymbols
|
|
# undef epicsExportSharedSymbols
|
|
#endif
|
|
|
|
#include <pv/sharedPtr.h>
|
|
|
|
#ifdef rpcServerEpicsExportSharedSymbols
|
|
# define epicsExportSharedSymbols
|
|
# undef rpcServerEpicsExportSharedSymbols
|
|
#endif
|
|
|
|
#include <pv/pvAccess.h>
|
|
#include <pv/rpcService.h>
|
|
#include <pv/serverContext.h>
|
|
|
|
#include <shareLib.h>
|
|
|
|
namespace epics { namespace pvAccess {
|
|
|
|
class epicsShareClass RPCServer :
|
|
public std::tr1::enable_shared_from_this<RPCServer>
|
|
{
|
|
private:
|
|
|
|
ServerContextImpl::shared_pointer m_serverContext;
|
|
ChannelProviderFactory::shared_pointer m_channelProviderFactory;
|
|
ChannelProvider::shared_pointer m_channelProviderImpl;
|
|
|
|
// TODO no thread poll implementation
|
|
|
|
public:
|
|
POINTER_DEFINITIONS(RPCServer);
|
|
|
|
RPCServer();
|
|
|
|
virtual ~RPCServer();
|
|
|
|
void registerService(epics::pvData::String const & serviceName, RPCService::shared_pointer const & service);
|
|
|
|
void unregisterService(epics::pvData::String const & serviceName);
|
|
|
|
void run(int seconds = 0);
|
|
|
|
/// Method requires usage of std::tr1::shared_ptr<RPCServer>. This instance must be
|
|
/// owned by a shared_ptr instance.
|
|
void runInNewThread(int seconds = 0);
|
|
|
|
void destroy();
|
|
|
|
/**
|
|
* Display basic information about the context.
|
|
*/
|
|
void printInfo();
|
|
|
|
};
|
|
|
|
|
|
}}
|
|
|
|
#endif /* RPCSERVER_H */
|