EPICS normative type C++ implementation

Draft, 4-Nov-2012

This version:
ntCPP.html
Editors:
Guobao Shen, BNL
Marty Kraimer, BNL

Normative Types


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.

License Agreement


Copyright (c) 2008 Martin R. Kraimer
Copyright (c) 2007 Control System Laboratory,
    (COSYLAB) Ljubljana Slovenia
Copyright (c) 2010 Brookhaven National Laboratory


Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following
conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.

________________________________________________________________________

This software is in part copyrighted by Brookhaven National Laboratory(BNL)

In no event shall BNL be liable to any party for direct, indirect,
special, incidental, or consequential damages arising out of the use of
this software, its documentation, or any derivatives thereof, even if
BNL has been advised of the possibility of such damage.

BNL specifically disclaims any warranties, including, but not limited
to, the implied warranties of merchantability, fitness for a particular
purpose, and non-infringement.  This software is provided on an "as is"
basis, and BNL has no obligation to provide maintenance, support,
updates, enhancements, or modifications.

________________________________________________________________________

This software is in part copyrighted by the BERLINER SPEICHERRING
GESELLSCHAFT FUER SYNCHROTRONSTRAHLUNG M.B.H. (BESSY), BERLIN, GERMANY.

In no event shall BESSY be liable to any party for direct, indirect,
special, incidental, or consequential damages arising out of the use of
this software, its documentation, or any derivatives thereof, even if
BESSY has been advised of the possibility of such damage.

BESSY specifically disclaims any warranties, including, but not limited
to, the implied warranties of merchantability, fitness for a particular
purpose, and non-infringement.  This software is provided on an "as is"
basis, and BESSY has no obligation to provide maintenance, support,
updates, enhancements, or modifications.

________________________________________________________________________

This software is in part copyrighted by the Deutsches Elektronen-Synchroton,
    Member of the Helmholtz Association, (DESY), HAMBURG, GERMANY.

In no event shall DESY be liable to any party for direct, indirect,
special, incidental, or consequential damages arising out of the use of
this software, its documentation, or any derivatives thereof, even if
DESY has been advised of the possibility of such damage.

DESY specifically disclaims any warranties, including, but not limited
to, the implied warranties of merchantability, fitness for a particular
purpose, and non-infringement.  This software is provided on an "as is"
basis, and DESY has no obligation to provide maintenance, support,
updates, enhancements, or modifications.
________________________________________________________________________