/* Copyright (c) 20011 Hovanes Egiyan 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. */ #ifndef _BaseIUInput_ #define _BaseIUInput_ #include #include #include #include "BaseIUException.hh" using namespace std; //! Class to deal with the input field recognition. There will be only //! one instance of this class since this will only be used from the //! EPICS device support. The format of the NIP and OUT field is //! "@pppp:aaaaa:ttttt:nnnn", where p-s stand for port name, //! a-s stand for board address in hex, t-s stand for parameter type, and //! n-s stands for parameter names, and b-s stand for bit name. class BaseIUInput { private: string biPortName; //! CANbus numbers int biAddress; //! Board address string biParType; //! Parameter type string biParName; //! Parameter name string biBitName; //! Bit of interest static string biSeparator; //! String separator //! Default constructor is disabled for this class. BaseIUInput(); public: //! class for exceptions at OPEN failures class BadString : public BaseIUException { private: BadString( const int code ) : BaseIUException( code ){;} public: BadString( const string str ) : BaseIUException( str ) {;} }; BaseIUInput( const string strInp ) ; BaseIUInput( const BaseIUInput& inp ); BaseIUInput& operator=( const BaseIUInput& inp ); //! Returns the CANbus number inline string GetPort() const { return biPortName; } //! Return the board number inline int GetAddress() const { return biAddress; } //! Returns the parameter type inline string GetParType() const { return biParType; } //! Returns the parameter name inline string GetParName() const { return biParName; } //! Returns the desired bit name inline string GetBitName() const { return biBitName; } }; #endif