This is Unofficial EPICS BASE Doxygen Site
epics::pvDatabase::TraceRecord Class Reference

Trace activity of PVRecord. More...

#include "traceRecord.h"

+ Inheritance diagram for epics::pvDatabase::TraceRecord:
+ Collaboration diagram for epics::pvDatabase::TraceRecord:

Public Member Functions

 POINTER_DEFINITIONS (TraceRecord)
 
virtual bool init ()
 
virtual void process ()
 Set the trace level for record specified by recordName. More...
 
- Public Member Functions inherited from epics::pvDatabase::PVRecord
 POINTER_DEFINITIONS (PVRecord)
 
virtual ~PVRecord ()
 
virtual void start ()
 Optional method for derived class. More...
 
virtual void destroy ()
 DEPRECATED. More...
 
virtual void remove ()
 remove record from database. More...
 
virtual epics::pvAccess::RPCServiceAsync::shared_pointer getService (epics::pvData::PVStructurePtr const &pvRequest)
 Optional method for derived class. More...
 
std::string getRecordName () const
 Get the name of the record. More...
 
PVRecordStructurePtr getPVRecordStructure () const
 Get the top level PVRecordStructure. More...
 
epics::pvData::PVStructurePtr getPVStructure () const
 Get the top level PVStructure. More...
 
PVRecordFieldPtr findPVRecordField (epics::pvData::PVFieldPtr const &pvField)
 Find the PVRecordField for the PVField. More...
 
void lock ()
 Lock the record. More...
 
void unlock ()
 Unlock the record. More...
 
bool tryLock ()
 Try to lock the record. More...
 
void lockOtherRecord (PVRecordPtr const &otherRecord)
 Lock another record. More...
 
bool addPVRecordClient (PVRecordClientPtr const &pvRecordClient)
 Add a client that wants to access the record. More...
 
bool addListener (PVListenerPtr const &pvListener, epics::pvCopy::PVCopyPtr const &pvCopy)
 Add a PVListener. More...
 
void nextMasterPVField (epics::pvData::PVFieldPtr const &pvField)
 PVCopyTraverseMasterCallback method. More...
 
bool removeListener (PVListenerPtr const &pvListener, epics::pvCopy::PVCopyPtr const &pvCopy)
 Remove a listener. More...
 
void beginGroupPut ()
 Begins a group of puts. More...
 
void endGroupPut ()
 Ends a group of puts. More...
 
int getTraceLevel ()
 get trace level (0,1,2) means (nothing,lifetime,process) More...
 
void setTraceLevel (int level)
 set trace level (0,1,2) means (nothing,lifetime,process) More...
 
- Public Member Functions inherited from epics::pvCopy::PVCopyTraverseMasterCallback
 POINTER_DEFINITIONS (PVCopyTraverseMasterCallback)
 
virtual ~PVCopyTraverseMasterCallback ()
 

Static Public Member Functions

static TraceRecordPtr create (std::string const &recordName)
 Factory method to create TraceRecord. More...
 
- Static Public Member Functions inherited from epics::pvDatabase::PVRecord
static PVRecordPtr create (std::string const &recordName, epics::pvData::PVStructurePtr const &pvStructure)
 Creates a soft record. More...
 

Additional Inherited Members

- Protected Member Functions inherited from epics::pvDatabase::PVRecord
 PVRecord (std::string const &recordName, epics::pvData::PVStructurePtr const &pvStructure)
 Constructor. More...
 
void initPVRecord ()
 Initializes the base class. More...
 

Detailed Description

Trace activity of PVRecord.

A record to set the trace value for another record It is meant to be used via a channelPutGet request. The argument has two fields: recordName and level. The result has a field named status.

Definition at line 33 of file traceRecord.h.

Member Function Documentation

TraceRecordPtr epics::pvDatabase::TraceRecord::create ( std::string const &  recordName)
static

Factory method to create TraceRecord.

Parameters
recordNameThe name for the TraceRecord.
Returns
A shared pointer to TraceRecord..

Definition at line 40 of file traceRecord.cpp.

42 {
43  FieldCreatePtr fieldCreate = getFieldCreate();
44  PVDataCreatePtr pvDataCreate = getPVDataCreate();
45  StructureConstPtr topStructure = fieldCreate->createFieldBuilder()->
46  addNestedStructure("argument")->
47  add("recordName",pvString)->
48  add("level",pvInt)->
49  endNested()->
50  addNestedStructure("result") ->
51  add("status",pvString) ->
52  endNested()->
53  createStructure();
54  PVStructurePtr pvStructure = pvDataCreate->createPVStructure(topStructure);
55  TraceRecordPtr pvRecord(
56  new TraceRecord(recordName,pvStructure));
57  if(!pvRecord->init()) pvRecord.reset();
58  return pvRecord;
59 }
std::tr1::shared_ptr< const Structure > StructureConstPtr
Definition: pvIntrospect.h:162
std::tr1::shared_ptr< PVDataCreate > PVDataCreatePtr
Definition: pvData.h:124
FORCE_INLINE const FieldCreatePtr & getFieldCreate()
std::tr1::shared_ptr< TraceRecord > TraceRecordPtr
Definition: traceRecord.h:22
std::tr1::shared_ptr< PVStructure > PVStructurePtr
Definition: pvData.h:87
std::tr1::shared_ptr< FieldCreate > FieldCreatePtr
FORCE_INLINE const PVDataCreatePtr & getPVDataCreate()
Definition: pvData.h:1648
bool epics::pvDatabase::TraceRecord::init ( )
virtual

standard init method required by PVRecord

Returns
true unless record name already exists.

Reimplemented from epics::pvDatabase::PVRecord.

Definition at line 69 of file traceRecord.cpp.

70 {
71  initPVRecord();
72  PVStructurePtr pvStructure = getPVStructure();
73  pvRecordName = pvStructure->getSubField<PVString>("argument.recordName");
74  if(!pvRecordName) return false;
75  pvLevel = pvStructure->getSubField<PVInt>("argument.level");
76  if(!pvLevel) return false;
77  pvResult = pvStructure->getSubField<PVString>("result.status");
78  if(!pvResult) return false;
79  return true;
80 }
epics::pvData::PVStructurePtr getPVStructure() const
Get the top level PVStructure.
Definition: pvDatabase.h:141
PVString is special case, since it implements SerializableArray.
Definition: pvData.h:521
std::tr1::shared_ptr< PVStructure > PVStructurePtr
Definition: pvData.h:87
void initPVRecord()
Initializes the base class.
Definition: pvRecord.cpp:110
Class that holds the data for each possible scalar type.
Definition: pvData.h:54
epics::pvDatabase::TraceRecord::POINTER_DEFINITIONS ( TraceRecord  )
void epics::pvDatabase::TraceRecord::process ( )
virtual

Set the trace level for record specified by recordName.

Reimplemented from epics::pvDatabase::PVRecord.

Definition at line 82 of file traceRecord.cpp.

83 {
84  string name = pvRecordName->get();
85  PVRecordPtr pvRecord = PVDatabase::getMaster()->findRecord(name);
86  if(!pvRecord) {
87  pvResult->put(name + " not found");
88  return;
89  }
90  pvRecord->setTraceLevel(pvLevel->get());
91  pvResult->put("success");
92 }
static PVDatabasePtr getMaster()
Get the master database.
Definition: pvDatabase.cpp:38
std::tr1::shared_ptr< PVRecord > PVRecordPtr
Definition: pvDatabase.h:21

The documentation for this class was generated from the following files: