This commit is contained in:
Michael Davidsaver
2015-09-10 16:10:36 -04:00
parent 7a415a958d
commit 3afd3a036a
3 changed files with 9 additions and 5 deletions

View File

@ -52,14 +52,14 @@ static void call1(const iocshArgBuf *args)
template<void (*fn)()>
void iocshRegister0(const char *name)
void iocshRegister(const char *name)
{
detail::iocshFuncInfo<0> *info = new detail::iocshFuncInfo<0>(name);
iocshRegister(&info->def, &detail::call0<fn>);
}
template<typename T, void (*fn)(T)>
void iocshRegister1(const char *name, const char *arg1name)
void iocshRegister(const char *name, const char *arg1name)
{
detail::iocshFuncInfo<1> *info = new detail::iocshFuncInfo<1>(name);
info->argnames[0] = arg1name;

View File

@ -1,11 +1,13 @@
#include <iocsh.h>
#include <libComRegister.h>
#define epicsExportSharedSymbols
#include "pva2pva.h"
int main(int argc, char *argv[])
{
libComRegister(); // non-IOC related iocsh functions
registerGWClientIocsh();
registerGWServerIocsh();
if(argc>1)

View File

@ -106,6 +106,8 @@ struct GWServerChannelProvider : public
return createChannel(channelName, channelRequester, priority, "foobar");
}
// The return value of this function is ignored
// The newly created channel is given to the ChannelRequester
virtual pva::Channel::shared_pointer createChannel(std::string const & channelName,
pva::ChannelRequester::shared_pointer const & channelRequester,
short priority, std::string const & address)
@ -302,9 +304,9 @@ void registerGWServerIocsh()
GWServerFactory.reset(new GWServerChannelProviderFactory);
pva::registerChannelProviderFactory(GWServerFactory);
iocshRegister0<&startServer>("gwstart");
iocshRegister0<&stopServer>("gwstop");
iocshRegister1<int, &statusServer>("gwstatus", "level");
iocshRegister<&startServer>("gwstart");
iocshRegister<&stopServer>("gwstop");
iocshRegister<int, &statusServer>("gwstatus", "level");
}