pvDatabaseCPP  4.7.1-dev
registerChannelProviderLocal.cpp
Go to the documentation of this file.
1 /*registerChannelProviderLocal.cpp*/
12 /* Author: Marty Kraimer */
13 
14 #include <iocsh.h>
15 #include <pv/pvAccess.h>
16 #include <pv/serverContext.h>
17 #include <pv/syncChannelFind.h>
18 #include <pv/pvTimeStamp.h>
19 #include <pv/rpcService.h>
20 #include <pv/timeStamp.h>
21 
22 // The following must be the last include for code pvDatabase uses
23 #include <epicsExport.h>
24 #define epicsExportSharedSymbols
25 #include "pv/pvDatabase.h"
27 
28 using std::cout;
29 using std::endl;
30 using namespace epics::pvData;
31 using namespace epics::pvAccess;
32 using namespace epics::pvDatabase;
33 
34 static const iocshFuncDef pvdblFuncDef = {
35  "pvdbl", 0, 0
36 };
37 extern "C" void pvdbl(const iocshArgBuf *args)
38 {
39  PVDatabasePtr master = PVDatabase::getMaster();
40  PVStringArrayPtr pvNames = master->getRecordNames();
41  PVStringArray::const_svector xxx = pvNames->view();
42  for(size_t i=0; i<xxx.size(); ++i) cout<< xxx[i] << endl;
43 }
44 
45 
46 static void registerChannelProviderLocal(void)
47 {
48  static int firstTime = 1;
49  if (firstTime) {
50  firstTime = 0;
51  iocshRegister(&pvdblFuncDef, pvdbl);
53  }
54 }
55 
56 extern "C" {
57  epicsExportRegistrar(registerChannelProviderLocal);
58 }
void pvdbl(const iocshArgBuf *args)
epicsShareFunc ChannelProviderLocalPtr getChannelProviderLocal()
epicsExportRegistrar(registerChannelProviderLocal)
std::tr1::shared_ptr< PVDatabase > PVDatabasePtr
Definition: pvDatabase.h:43