Program Listing for File pvDisplay.h

Return to documentation for file (src/property/pv/pvDisplay.h)

/* pvDisplay.h */
/*
 * Copyright information and license terms for this software can be
 * found in the file LICENSE that is included with the distribution
 */
#ifndef PVDISPLAY_H
#define PVDISPLAY_H

#include <string>

#include <pv/pvType.h>
#include <pv/pvData.h>
#include <pv/display.h>

#include <shareLib.h>

namespace epics { namespace pvData {

class epicsShareClass PVDisplay {
public:
    PVDisplay() {}
    //default constructors and destructor are OK
    //An automatic detach is issued if already attached.
    /*
     * Attach to a field of a PVData object.
     * @param pvField The pvField.
     * @return (false,true) if the pvField (is not, is) an display structure.
     */
    bool attach(PVFieldPtr const & pvField);
    void detach();
    bool isAttached();
    // each of the following throws logic_error if not attached to PVField
    // a set returns false if field is immutable
    void get(Display & display) const;
    bool set(Display const & display);
private:
    static std::string noDisplayFound;
    static std::string notAttached;
    PVStringPtr pvDescription;
    PVStringPtr pvFormat;
    PVStringPtr pvUnits;
    PVDoublePtr pvLow;
    PVDoublePtr pvHigh;
};

}}
#endif  /* PVDISPLAY_H */