This is Unofficial EPICS BASE Doxygen Site
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 cout << "registerChannelProviderLocal firstTime " << (firstTime ? "true" : "false") << endl;
50  if (firstTime) {
51  firstTime = 0;
52  iocshRegister(&pvdblFuncDef, pvdbl);
54  }
55 }
56 
57 extern "C" {
58  epicsExportRegistrar(registerChannelProviderLocal);
59 }
void pvdbl(const iocshArgBuf *args)
epicsShareFunc ChannelProviderLocalPtr getChannelProviderLocal()
int i
Definition: scan.c:967
epicsExportRegistrar(registerChannelProviderLocal)
std::tr1::shared_ptr< PVStringArray > PVStringArrayPtr
Definition: pvData.h:1464
void iocshRegister(const char *name)
Definition: iocshelper.h:105
std::tr1::shared_ptr< PVDatabase > PVDatabasePtr
Definition: pvDatabase.h:43
Holds all PVA related.
Definition: pvif.h:34
pvData
Definition: monitor.h:428
size_t size() const
Number of elements visible through this vector.
Definition: sharedVector.h:220
Exporting IOC objects.