ISIS Logo
NINetVar
An EPICS support module to export National Instruments Network Shared Variables as process variables
Public Member Functions | Private Types | Private Member Functions | Static Private Member Functions | Private Attributes | List of all members
NINetVarInterface Class Reference

Manager class for the NetVar Interaction. Parses an netvarconfig.xml file and provides access to the 9variables described within. More...

#include <NINetVarInterface.h>

Public Member Functions

 NINetVarInterface (const char *configSection, const char *configFile, int options)
 section name of configFile to use to configure this asyn port More...
 
long nParams ()
 
 ~NINetVarInterface ()
 
void updateValues ()
 
void createParams (asynPortDriver *driver)
 
void report (FILE *fp, int details)
 Helper for EPICS driver report function. More...
 
template<typename T >
void setValue (const char *param, const T &value)
 
template<typename T >
void setArrayValue (const char *param, const T *value, size_t nElements)
 
void dataTransferredCallback (void *handle, int error, CallbackData *cb_data)
 called when data has been transferred to the variable More...
 
void dataCallback (void *handle, CNVData data, CallbackData *cb_data)
 called when new data is available on a subscriber connection More...
 
void statusCallback (void *handle, CNVConnectionStatus status, int error, CallbackData *cb_data)
 called when status of a network shared variable changes More...
 
template<typename T >
void readArrayValue (const char *paramName, T *value, size_t nElements, size_t *nIn)
 
template<>
void setValue (const char *param, const std::string &value)
 

Private Types

typedef std::map< std::string,
NvItem * > 
params_t
 

Private Member Functions

void getParams ()
 
void DomFromCOM ()
 
void setValueCNV (const std::string &name, CNVData value)
 
bool checkOption (NINetVarOptions option)
 
void connectVars ()
 
template<typename T >
void updateParamValue (int param_index, T val, bool do_asyn_param_callbacks)
 
template<typename T >
void updateParamArrayValue (int param_index, T *val, size_t nElements)
 
void updateParamCNV (int param_index, CNVData data, bool do_asyn_param_callbacks)
 
template<CNVDataType cnvType>
void updateParamCNVImpl (int param_index, CNVData data, CNVDataType type, unsigned int nDims, bool do_asyn_param_callbacks)
 
template<typename T , typename U >
void updateParamArrayValueImpl (int param_index, T *val, size_t nElements)
 

Static Private Member Functions

static void epicsExitFunc (void *arg)
 

Private Attributes

std::string m_configSection
 section of configFile to load information from More...
 
std::string m_configFile
 
int m_options
 the various NINetVarOptions currently in use More...
 
IXMLDOMDocument2 * m_pxmldom
 
asynPortDriver * m_driver
 
params_t m_params
 

Detailed Description

Manager class for the NetVar Interaction. Parses an netvarconfig.xml file and provides access to the 9variables described within.

Definition at line 47 of file NINetVarInterface.h.

Member Typedef Documentation

typedef std::map<std::string,NvItem*> NINetVarInterface::params_t
private

Definition at line 70 of file NINetVarInterface.h.

Constructor & Destructor Documentation

NINetVarInterface::NINetVarInterface ( const char *  configSection,
const char *  configFile,
int  options 
)

section name of configFile to use to configure this asyn port

Parameters
[in]configSection
[in]configFilePath to the XML input file to load configuration information from.
[in]optionsoptions as per NINetVarOptions enum

Definition at line 601 of file NINetVarInterface.cpp.

References DomFromCOM(), epicsExitFunc(), initCV(), m_configFile, m_pxmldom, and onceId.

NINetVarInterface::~NINetVarInterface ( )
inline

Definition at line 52 of file NINetVarInterface.h.

References m_pxmldom.

Member Function Documentation

bool NINetVarInterface::checkOption ( NINetVarOptions  option)
inlineprivate

Definition at line 77 of file NINetVarInterface.h.

void NINetVarInterface::connectVars ( )
private
void NINetVarInterface::createParams ( asynPortDriver *  driver)
void NINetVarInterface::dataCallback ( void *  handle,
CNVData  data,
CallbackData cb_data 
)

called when new data is available on a subscriber connection

Definition at line 286 of file NINetVarInterface.cpp.

References CallbackData::param_index, and updateParamCNV().

Referenced by DataCallback().

void NINetVarInterface::dataTransferredCallback ( void *  handle,
int  error,
CallbackData cb_data 
)

called when data has been transferred to the variable

Definition at line 265 of file NINetVarInterface.cpp.

References CallbackData::nv_name.

Referenced by DataTransferredCallback().

void NINetVarInterface::DomFromCOM ( )
private

Definition at line 577 of file NINetVarInterface.cpp.

References m_pxmldom.

Referenced by NINetVarInterface().

void NINetVarInterface::epicsExitFunc ( void *  arg)
staticprivate

Definition at line 625 of file NINetVarInterface.cpp.

Referenced by NINetVarInterface().

void NINetVarInterface::getParams ( )
private
long NINetVarInterface::nParams ( )

Definition at line 638 of file NINetVarInterface.cpp.

References m_configSection, m_pxmldom, and MAX_PATH_LEN.

template<typename T >
void NINetVarInterface::readArrayValue ( const char *  paramName,
T *  value,
size_t  nElements,
size_t *  nIn 
)

Definition at line 385 of file NINetVarInterface.cpp.

References m_params.

Referenced by NINetVarDriver::readArrayValue().

void NINetVarInterface::report ( FILE *  fp,
int  details 
)

Helper for EPICS driver report function.

Definition at line 889 of file NINetVarInterface.cpp.

References m_configFile, m_configSection, m_options, m_params, and NvItem::report().

Referenced by NINetVarDriver::report().

template<typename T >
void NINetVarInterface::setArrayValue ( const char *  param,
const T *  value,
size_t  nElements 
)

Definition at line 819 of file NINetVarInterface.cpp.

References ERROR_CHECK, and setValueCNV().

Referenced by NINetVarDriver::writeArrayValue().

template<typename T >
void NINetVarInterface::setValue ( const char *  param,
const T &  value 
)

Definition at line 810 of file NINetVarInterface.cpp.

References ERROR_CHECK, and setValueCNV().

Referenced by NINetVarDriver::writeOctet(), and NINetVarDriver::writeValue().

template<>
void NINetVarInterface::setValue ( const char *  param,
const std::string &  value 
)

Definition at line 801 of file NINetVarInterface.cpp.

References ERROR_CHECK, and setValueCNV().

void NINetVarInterface::setValueCNV ( const std::string &  name,
CNVData  value 
)
private
void NINetVarInterface::statusCallback ( void *  handle,
CNVConnectionStatus  status,
int  error,
CallbackData cb_data 
)

called when status of a network shared variable changes

Definition at line 556 of file NINetVarInterface.cpp.

References connectionStatus(), and CallbackData::nv_name.

Referenced by StatusCallback().

template<typename T >
void NINetVarInterface::updateParamArrayValue ( int  param_index,
T *  val,
size_t  nElements 
)
private

Definition at line 352 of file NINetVarInterface.cpp.

References m_driver, and m_params.

Referenced by updateParamCNVImpl().

template<typename T , typename U >
void NINetVarInterface::updateParamArrayValueImpl ( int  param_index,
T *  val,
size_t  nElements 
)
private

Definition at line 333 of file NINetVarInterface.cpp.

References m_driver, and m_params.

void NINetVarInterface::updateParamCNV ( int  param_index,
CNVData  data,
bool  do_asyn_param_callbacks 
)
private

Definition at line 427 of file NINetVarInterface.cpp.

References dataQuality(), ERROR_CHECK, m_driver, and m_params.

Referenced by dataCallback(), and updateValues().

template<CNVDataType cnvType>
void NINetVarInterface::updateParamCNVImpl ( int  param_index,
CNVData  data,
CNVDataType  type,
unsigned int  nDims,
bool  do_asyn_param_callbacks 
)
private
template<typename T >
void NINetVarInterface::updateParamValue ( int  param_index,
val,
bool  do_asyn_param_callbacks 
)
private

Definition at line 304 of file NINetVarInterface.cpp.

References m_driver, and m_params.

Referenced by updateParamCNVImpl().

void NINetVarInterface::updateValues ( )

Member Data Documentation

std::string NINetVarInterface::m_configFile
private

Definition at line 65 of file NINetVarInterface.h.

Referenced by NINetVarInterface(), and report().

std::string NINetVarInterface::m_configSection
private

section of configFile to load information from

Definition at line 64 of file NINetVarInterface.h.

Referenced by getParams(), nParams(), and report().

asynPortDriver* NINetVarInterface::m_driver
private
int NINetVarInterface::m_options
private

the various NINetVarOptions currently in use

Definition at line 66 of file NINetVarInterface.h.

Referenced by report().

params_t NINetVarInterface::m_params
private
IXMLDOMDocument2* NINetVarInterface::m_pxmldom
private

The documentation for this class was generated from the following files:
Copyright © 2013 Science and Technology Facilities Council | Generated by   doxygen 1.8.8