58 lines
1.4 KiB
C++
58 lines
1.4 KiB
C++
/*exampleServerMain.cpp */
|
|
/**
|
|
* Copyright - See the COPYRIGHT that is included with this distribution.
|
|
* EPICS pvData is distributed subject to a Software License Agreement found
|
|
* in file LICENSE that is included with this distribution.
|
|
*/
|
|
/**
|
|
* @author mrk
|
|
*/
|
|
|
|
/* Author: Marty Kraimer */
|
|
|
|
#include <cstddef>
|
|
#include <cstdlib>
|
|
#include <cstddef>
|
|
#include <string>
|
|
#include <cstdio>
|
|
#include <memory>
|
|
#include <vector>
|
|
#include <iostream>
|
|
|
|
#include <pv/channelProviderLocal.h>
|
|
#include <pv/exampleServerCreateRecords.h>
|
|
#include <pv/serverContext.h>
|
|
|
|
using namespace std;
|
|
using std::tr1::static_pointer_cast;
|
|
using namespace epics::pvData;
|
|
using namespace epics::pvAccess;
|
|
using namespace epics::pvDatabase;
|
|
|
|
|
|
int main(int argc,char *argv[])
|
|
{
|
|
PVDatabasePtr master = PVDatabase::getMaster();
|
|
ChannelProviderLocalPtr channelProvider = getChannelProviderLocal();
|
|
ExampleServerCreateRecords::create();
|
|
ServerContext::shared_pointer ctx =
|
|
startPVAServer(PVACCESS_ALL_PROVIDERS,0,true,true);
|
|
cout << "exampleServer\n";
|
|
PVStringArrayPtr pvNames = master->getRecordNames();
|
|
String buffer;
|
|
pvNames->toString(&buffer);
|
|
cout << "recordNames" << endl << buffer << endl;
|
|
string str;
|
|
while(true) {
|
|
cout << "Type exit to stop: \n";
|
|
getline(cin,str);
|
|
if(str.compare("exit")==0) break;
|
|
|
|
}
|
|
ctx->destroy();
|
|
epicsThreadSleep(1.0);
|
|
channelProvider->destroy();
|
|
return 0;
|
|
}
|
|
|