diff --git a/pvtoolsSrc/Makefile b/pvtoolsSrc/Makefile index 90e9248..c841412 100644 --- a/pvtoolsSrc/Makefile +++ b/pvtoolsSrc/Makefile @@ -2,6 +2,8 @@ TOP=.. include $(TOP)/configure/CONFIG +USR_CPPFLAGS += -I$(TOP)/src/remote + PROD_HOST += pvget pvget_SRCS += pvget.cpp pvget_LIBS += pvAccess pvData $(MBLIB) ca Com diff --git a/src/pva/Makefile b/src/pva/Makefile index a1b75dc..1bf2665 100644 --- a/src/pva/Makefile +++ b/src/pva/Makefile @@ -3,6 +3,7 @@ SRC_DIRS += $(PVACCESS_SRC)/pva INC += pv/pvaConstants.h +INC += pv/pvaDefs.h INC += pv/pvaVersion.h INC += pv/pvaVersionNum.h INC += pv/clientFactory.h diff --git a/src/pva/pv/pvaDefs.h b/src/pva/pv/pvaDefs.h new file mode 100644 index 0000000..6497d47 --- /dev/null +++ b/src/pva/pv/pvaDefs.h @@ -0,0 +1,22 @@ +#ifndef PVADEFS_H +#define PVADEFS_H + +#include +#include +#include + +namespace epics { +namespace pvAccess { + +/** + * Globally unique ID. + */ +typedef struct { + char value[12]; +} GUID; + +typedef epicsInt32 pvAccessID; + +}} + +#endif // PVADEFS_H diff --git a/src/remote/Makefile b/src/remote/Makefile index 6b7a417..943cf9d 100644 --- a/src/remote/Makefile +++ b/src/remote/Makefile @@ -2,16 +2,8 @@ SRC_DIRS += $(PVACCESS_SRC)/remote -INC += pv/remote.h INC += pv/security.h -INC += pv/blockingUDP.h -INC += pv/beaconHandler.h -INC += pv/blockingTCP.h -INC += pv/channelSearchManager.h -INC += pv/simpleChannelSearchManagerImpl.h -INC += pv/transportRegistry.h INC += pv/serializationHelper.h -INC += pv/codec.h LIBSRCS += blockingUDPTransport.cpp LIBSRCS += blockingUDPConnector.cpp diff --git a/src/remote/pv/beaconHandler.h b/src/remote/pv/beaconHandler.h index e437e17..289bc6a 100644 --- a/src/remote/pv/beaconHandler.h +++ b/src/remote/pv/beaconHandler.h @@ -22,6 +22,7 @@ # undef beaconHandlerEpicsExportSharedSymbols #endif +#include #include #include diff --git a/src/remote/pv/channelSearchManager.h b/src/remote/pv/channelSearchManager.h index 18bb5de..40a0991 100644 --- a/src/remote/pv/channelSearchManager.h +++ b/src/remote/pv/channelSearchManager.h @@ -19,7 +19,7 @@ # undef channelSearchManagerEpicsExportSharedSymbols #endif -#include +#include namespace epics { namespace pvAccess { diff --git a/src/remote/pv/remote.h b/src/remote/pv/remote.h index 1b66f2b..1e5d2ed 100644 --- a/src/remote/pv/remote.h +++ b/src/remote/pv/remote.h @@ -33,6 +33,7 @@ #include #include #include +#include /// TODO only here because of the Lockable #include @@ -48,13 +49,6 @@ namespace pvAccess { class TransportRegistry; -/** - * Globally unique ID. - */ -typedef struct { - char value[12]; -} GUID; - enum QoS { /** * Default behavior. @@ -94,8 +88,6 @@ enum QoS { QOS_GET_PUT = 0x80 }; -typedef epics::pvData::int32 pvAccessID; - enum ApplicationCommands { CMD_BEACON = 0, CMD_CONNECTION_VALIDATION = 1, diff --git a/src/remote/pv/security.h b/src/remote/pv/security.h index 97aced7..75ccbb6 100644 --- a/src/remote/pv/security.h +++ b/src/remote/pv/security.h @@ -25,7 +25,8 @@ # undef securityEpicsExportSharedSymbols #endif -#include +#include +#include #include #include @@ -412,26 +413,6 @@ public: } }; -class AuthNZHandler : - public AbstractResponseHandler, - private epics::pvData::NoDefaultMethods -{ -public: - AuthNZHandler(Context* context) : - AbstractResponseHandler(context, "authNZ message") - { - } - - virtual ~AuthNZHandler() {} - - virtual void handleResponse(osiSockAddr* responseFrom, - Transport::shared_pointer const & transport, - epics::pvData::int8 version, - epics::pvData::int8 command, - size_t payloadSize, - epics::pvData::ByteBuffer* payloadBuffer); -}; - class epicsShareClass SecurityPluginRegistry : private epics::pvData::NoDefaultMethods { diff --git a/src/remote/pv/securityImpl.h b/src/remote/pv/securityImpl.h new file mode 100644 index 0000000..e90b3f4 --- /dev/null +++ b/src/remote/pv/securityImpl.h @@ -0,0 +1,34 @@ +#ifndef SECURITYIMPL_H +#define SECURITYIMPL_H + +#include + +#include "security.h" + +namespace epics { +namespace pvAccess { + + +class AuthNZHandler : + public AbstractResponseHandler, + private epics::pvData::NoDefaultMethods +{ +public: + AuthNZHandler(Context* context) : + AbstractResponseHandler(context, "authNZ message") + { + } + + virtual ~AuthNZHandler() {} + + virtual void handleResponse(osiSockAddr* responseFrom, + Transport::shared_pointer const & transport, + epics::pvData::int8 version, + epics::pvData::int8 command, + size_t payloadSize, + epics::pvData::ByteBuffer* payloadBuffer); +}; + +}} + +#endif // SECURITYIMPL_H diff --git a/src/remote/pv/simpleChannelSearchManagerImpl.h b/src/remote/pv/simpleChannelSearchManagerImpl.h index 0008dcc..09dd762 100644 --- a/src/remote/pv/simpleChannelSearchManagerImpl.h +++ b/src/remote/pv/simpleChannelSearchManagerImpl.h @@ -22,6 +22,7 @@ #endif #include +#include namespace epics { namespace pvAccess { diff --git a/src/remote/security.cpp b/src/remote/security.cpp index 92a680c..9c5f2c2 100644 --- a/src/remote/security.cpp +++ b/src/remote/security.cpp @@ -7,7 +7,7 @@ #include #define epicsExportSharedSymbols -#include +#include using namespace epics::pvData; using namespace epics::pvAccess; diff --git a/src/remoteClient/Makefile b/src/remoteClient/Makefile index 494f695..25ef118 100644 --- a/src/remoteClient/Makefile +++ b/src/remoteClient/Makefile @@ -2,6 +2,4 @@ SRC_DIRS += $(PVACCESS_SRC)/remoteClient -INC += pv/clientContextImpl.h - LIBSRCS += clientContextImpl.cpp diff --git a/src/remoteClient/clientContextImpl.cpp b/src/remoteClient/clientContextImpl.cpp index 1542067..b5a2033 100644 --- a/src/remoteClient/clientContextImpl.cpp +++ b/src/remoteClient/clientContextImpl.cpp @@ -32,7 +32,7 @@ #include #include #include -#include +#include #include diff --git a/src/rpcService/pv/rpcServer.h b/src/rpcService/pv/rpcServer.h index 4182011..454bce0 100644 --- a/src/rpcService/pv/rpcServer.h +++ b/src/rpcService/pv/rpcServer.h @@ -21,19 +21,21 @@ #include #include -#include +#include #include namespace epics { namespace pvAccess { +class ServerContext; + class epicsShareClass RPCServer : public std::tr1::enable_shared_from_this { private: - ServerContextImpl::shared_pointer m_serverContext; + std::tr1::shared_ptr m_serverContext; ChannelProviderFactory::shared_pointer m_channelProviderFactory; ChannelProvider::shared_pointer m_channelProviderImpl; diff --git a/src/rpcService/rpcServer.cpp b/src/rpcService/rpcServer.cpp index f2e7f3c..e87ce35 100644 --- a/src/rpcService/rpcServer.cpp +++ b/src/rpcService/rpcServer.cpp @@ -10,6 +10,7 @@ #define epicsExportSharedSymbols #include +#include #include using namespace epics::pvData; @@ -525,7 +526,7 @@ RPCServer::RPCServer() m_channelProviderImpl = m_channelProviderFactory->sharedInstance(); m_serverContext = ServerContextImpl::create(); - m_serverContext->setChannelProviderName(m_channelProviderImpl->getProviderName()); + static_cast(m_serverContext.get())->setChannelProviderName(m_channelProviderImpl->getProviderName()); m_serverContext->initialize(getChannelProviderRegistry()); } diff --git a/src/server/Makefile b/src/server/Makefile index 3334bae..2e841be 100644 --- a/src/server/Makefile +++ b/src/server/Makefile @@ -3,10 +3,7 @@ SRC_DIRS += $(PVACCESS_SRC)/server INC += pv/serverContext.h -INC += pv/responseHandlers.h INC += pv/serverChannelImpl.h -INC += pv/baseChannelRequester.h -INC += pv/beaconEmitter.h INC += pv/beaconServerStatusProvider.h LIBSRCS += responseHandlers.cpp diff --git a/src/server/pv/serverContext.h b/src/server/pv/serverContext.h index 66e23b6..42147a9 100644 --- a/src/server/pv/serverContext.h +++ b/src/server/pv/serverContext.h @@ -7,15 +7,13 @@ #ifndef SERVERCONTEXT_H_ #define SERVERCONTEXT_H_ -#include +#include + +#include #include #include #include #include -#include -#include -#include -#include #include diff --git a/src/server/pv/serverContextImpl.h b/src/server/pv/serverContextImpl.h index 17ad4d2..a5df9ba 100644 --- a/src/server/pv/serverContextImpl.h +++ b/src/server/pv/serverContextImpl.h @@ -1,6 +1,10 @@ #ifndef SERVERCONTEXTIMPL_H #define SERVERCONTEXTIMPL_H +#include +#include +#include + #include "serverContext.h" namespace epics { diff --git a/src/server/responseHandlers.cpp b/src/server/responseHandlers.cpp index 41cee50..04369cf 100644 --- a/src/server/responseHandlers.cpp +++ b/src/server/responseHandlers.cpp @@ -39,7 +39,7 @@ #include #include #include -#include +#include using std::string; using std::ostringstream; diff --git a/src/server/serverContext.cpp b/src/server/serverContext.cpp index 21068d8..d66b1c5 100644 --- a/src/server/serverContext.cpp +++ b/src/server/serverContext.cpp @@ -653,7 +653,7 @@ ServerContext::shared_pointer startPVAServer(std::string const & providerNames, if (runInSeparateThread) { - // delete left to the thread + // delete left to the thread (which doesn't) auto_ptr param(new ThreadRunnerParam()); param->ctx = ctx; param->timeToRun = timeToRun; @@ -665,6 +665,7 @@ ServerContext::shared_pointer startPVAServer(std::string const & providerNames, threadRunner, param.get()); param.release(); + // leak... } else { diff --git a/testApp/Makefile b/testApp/Makefile index 9f9cd10..22139aa 100644 --- a/testApp/Makefile +++ b/testApp/Makefile @@ -3,7 +3,9 @@ TOP = .. include $(TOP)/configure/CONFIG -USR_CPPFLAGS += -I$(TOP)/src/server/pv +USR_CPPFLAGS += -I$(TOP)/src/server +USR_CPPFLAGS += -I$(TOP)/src/remote +USR_CPPFLAGS += -I$(TOP)/src/remoteClient PVACCESS_TEST = $(TOP)/testApp