EPICS pvDataCPP

EPICS v4 Working Group, Working Draft, 23-July-2014

Latest version:
pvDataCPP.html
This version:
pvDataCPP_20140708.html
Previous version:
pvDataCPP_20140501.html
Editors:
Marty Kraimer, BNL
Michael Davidsaver, BNL
Matej Sekoranja, CosyLab

Abstract

EPICS Version 4 provides efficient storage, access, and communication, of memory resident structured data. pvData is the storage compoment. pvDataCPP is the C++ implementation of pvData. It is one part of the set of related products in the EPICS V4 control system programming environment:
relatedDocumentsV4.html

Status of this Document

For now this is a working copy so it is not the same as "This version" shown above.

This is the 23-July-2014 version of the C++ implementation of pvData.

RELEASE_NOTES.md provides changes since the last release. TODO.md describes things to do before the next release.

Table of Contents

EPICS normative type C++ implementation

Draft, 4-Nov-2012

This version:
ntCPP.html
Editors:
Matej Sekoranja, CosyLab
Marty Kraimer, BNL

Introduction

This section describes the C++ implemmentation of normative types. Two (2) helper classes are implemented, ntNameValue and NTTable respectively.

Normative Type Fields.

These are helper classes for creating standard fields for normative types. There is a single instance of this class, which is obtained via NTField::get().

class NTField: NoDefaultMethods {
public:
    static NTFieldPtr get();
    ~NTField() {}

    PVStructurePtr createEnumerated(StringArray const & choices);
    PVStructurePtr createTimeStamp();
    PVStructurePtr createAlarm();
    PVStructurePtr createDisplay();
    PVStructurePtr createAlarmLimit();
    PVStructurePtr createControl();

    PVStructureArrayPtr createEnumeratedArray();
    PVStructureArrayPtr createTimeStampArray();
    PVStructureArrayPtr createAlarmArray();
};

where

createEnumerated
Create an introspection interface for an enumerated structure.
createTimeStamp
Create an interspection interface for a timeStamp structure.
createAlarm
Create an interspection interface for an alarm structure.
createDisplay
Create an introsepecion interface for a display structure.
createAlarmLimit
Create an introspection interface for an alarm limit structure.
createControl
Create an introspection interface for a control structure.
createEnumeratedArray
Create an introspection interface for an structureArray of enumerated structures.
createTimeStampArray
Create an introspection interface for an structureArray of timeStamp structures.
createAlarmArray
Create an introspection interface for an structureArray of alarm structures.

NTNameValue

These are helper classes for NTNameValue

class NTNameValue : private NoDefaultMethods
{
public:
    static bool isNTNameValue(PVStructurePtr const & pvStructure);
    static NTNameValuePtr create(
        bool hasFunction,bool hasTimeStamp, bool hasAlarm);
    static NTNameValuePtr create(
        PVStructurePtr const & pvStructure);
    ~NTNameValue();
    PVStringPtr getFunction();
    void attachTimeStamp(PVTimeStamp &pvTimeStamp);
    void attachAlarm(PVAlarm &pvAlarm);
    PVStructurePtr getPVStructure();
    PVStructurePtr getTimeStamp();
    PVStructurePtr getAlarm();
    PVStringArrayPtr getNames();
    PVStringArrayPtr getValues();
};

where

isNTNameValue
Is the structure a NTNameValue structure?
create
Create an NTNameValue that has the associated fields.
~NTNameValue
The destructor.
getFunction
Get the function field. This can be null.
attachTimeStamp
The timeStamp field of the NTNameValue is atttached to the pvTimeStamp.
attachAlarm
The alarm field of the NTNameValue is atttached to the alarm.
getPVStructure
Get the pvStructure that this NTNameValue contains.
getTimeStamp
Get the timeStamp field.
getAlarm
Get the alarm field.
getNames
Get the names field.
getValues
Get the values field.

NTTable

These are helper classes for NTTable

class NTTable: private NoDefaultMethods
{
public:
    static bool isNTTable(PVStructurePtr const & pvStructure);
    static PVStructure::shared_pointer create(
        bool hasFunction,bool hasTimeStamp, bool hasAlarm,
        int numberValues,
        FieldConstPtrArray valueFields);
        static NTTablePtr create(
            bool hasFunction,bool hasTimeStamp, bool hasAlarm,
            StringArray const & valueNames,
            FieldConstPtrArray const &valueFields);
        static NTTablePtr clone(PVStructurePtr const &);
    ~NTTable();
    PVStringPtr getFunction();
    void attachTimeStamp(PVTimeStamp &pvTimeStamp);
    void attachAlarm(PVAlarm &pvAlarm);
    PVStructurePtr getPVStructure();
    PVStructurePtr getTimeStamp();
    PVStructurePtr getAlarm();
    PVStringArrayPtr getLabel();
    size_t getNumberValues();
    FieldConstPtr getField(int index);
    PVFieldPtr getPVField(int index);
};

where

isNTTable
y
create
Create an NTTable that has the associated fields.
~NTTable
The destructor.
getFunction
Get the function field. This can be null.
attachTimeStamp
The timeStamp field of the NTTable is atttached to the pvTimeStamp.
attachAlarm
The alarm field of the NTTable is atttached to the alarm.
getPVStructure
Get the pvStructure that this NTTable contains.
getTimeStamp
Get the timeStamp field.
getAlarm
Get the alarm field.
getLabel
Get the label field.
getNumberValues
Get the number of value fields.
getField
Get the introspection interface for the specified field.
getPVField
Get the data field for the specified field.

MTMultiChannel

structure NTMultiChannel
  union_t[] value       
  string[]  channelName    
  time_t    timeStamp        :opt // time when data collected
  alarm_t   alarm            :opt // alarm associated with data collection
  int[]     severity         :opt // alarm severity for each value
  int[]     status           :opt // alarm status for each value
  string[]  message          :opt // alarm message for each value
  long[]    secondsPastEpoch :opt // seconds for each value.
  int[]     nanoseconds      :opt // nanoseconds for each value
  string    descriptor       :opt // descriptor data