beaconEmitter and handler (not finished)
This commit is contained in:
50
pvAccessApp/remote/beaconServerStatusProvider.cpp
Normal file
50
pvAccessApp/remote/beaconServerStatusProvider.cpp
Normal file
@@ -0,0 +1,50 @@
|
||||
/*
|
||||
* beaconServerStatusProvider.cpp
|
||||
*/
|
||||
|
||||
#include "beaconServerStatusProvider.h"
|
||||
|
||||
namespace epics { namespace pvAccess {
|
||||
|
||||
BeaconServerStatusProvider::BeaconServerStatusProvider( ServerContext* context): _context(context)
|
||||
{
|
||||
if(context == NULL)
|
||||
{
|
||||
throw EpicsException("null context");
|
||||
}
|
||||
initialize();
|
||||
}
|
||||
|
||||
BeaconServerStatusProvider::BeaconServerStatusProvider()
|
||||
{
|
||||
initialize();
|
||||
}
|
||||
|
||||
BeaconServerStatusProvider::~BeaconServerStatusProvider()
|
||||
{
|
||||
}
|
||||
|
||||
void BeaconServerStatusProvider::initialize()
|
||||
{
|
||||
PVDataCreate* pvDataCreate = getPVDataCreate();
|
||||
FieldCreate* fieldCreate = getFieldCreate();
|
||||
FieldConstPtrArray fields = new FieldConstPtr[6];
|
||||
// TODO hierarchy can be used...
|
||||
fields[0] = fieldCreate->createScalar("connections",pvInt);
|
||||
fields[1] = fieldCreate->createScalar("allocatedMemory",pvLong);
|
||||
fields[2] = fieldCreate->createScalar("freeMemory",pvLong);
|
||||
fields[3] = fieldCreate->createScalar("threads",pvInt);
|
||||
fields[4] = fieldCreate->createScalar("deadlocks",pvInt);
|
||||
fields[5] = fieldCreate->createScalar("averageSystemLoad",pvDouble);
|
||||
|
||||
_status = pvDataCreate->createPVStructure(NULL,"status",6,fields);
|
||||
}
|
||||
|
||||
PVFieldPtr BeaconServerStatusProvider::getServerStatusData()
|
||||
{
|
||||
//TODO implement
|
||||
return static_cast<PVFieldPtr>(_status);
|
||||
}
|
||||
|
||||
}}
|
||||
|
||||
Reference in New Issue
Block a user