"Fossies" - the Fresh Open Source Software Archive

Member "opensaf-5.21.09/src/imm/immnd/ImmAttrValue.h" (14 Sep 2021, 2870 Bytes) of package /linux/misc/opensaf-5.21.09.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "ImmAttrValue.h" see the Fossies "Dox" file reference documentation and the latest Fossies "Diffs" side-by-side code changes report: 5.21.06_vs_5.21.09.

    1 /*      -*- OpenSAF  -*-
    2  *
    3  * (C) Copyright 2008 The OpenSAF Foundation
    4  *
    5  * This program is distributed in the hope that it will be useful, but
    6  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
    7  * or FITNESS FOR A PARTICULAR PURPOSE. This file and program are licensed
    8  * under the GNU Lesser General Public License Version 2.1, February 1999.
    9  * The complete license can be accessed from the following location:
   10  * http://opensource.org/licenses/lgpl-license.php
   11  * See the Copying file included with the OpenSAF distribution for full
   12  * licensing terms.
   13  *
   14  * Author(s): Ericsson AB
   15  *
   16  */
   17 
   18 /*
   19   ImmAttrValue.hh  should be immnd_attr_value.hh ??
   20   Only included by the IMMND.
   21 */
   22 
   23 #ifndef IMM_IMMND_IMMATTRVALUE_H_
   24 #define IMM_IMMND_IMMATTRVALUE_H_ 1
   25 
   26 #include "imm/common/immsv_evt_model.h"
   27 
   28 /**
   29  *
   30  */
   31 class ImmAttrValue {
   32  public:
   33   ImmAttrValue();
   34   ImmAttrValue(const ImmAttrValue& b);
   35   virtual ~ImmAttrValue();
   36   virtual bool isMultiValued() const;
   37   virtual unsigned int extraValues() const;
   38   virtual void discardValues();
   39   virtual void print() const;
   40   virtual void removeValue(const IMMSV_OCTET_STRING& match);
   41   virtual bool hasMatchingValue(const IMMSV_OCTET_STRING& match) const;
   42   virtual bool hasDuplicates() const;
   43 
   44   void printSimpleValue() const;
   45 
   46   ImmAttrValue& operator=(const ImmAttrValue& b);
   47 
   48   void setValue_int(int i);
   49   int getValue_int() const;
   50   void setValue_satimet(SaTimeT i);
   51   SaTimeT getValue_satimet() const;
   52   void setValueC_str(const char* str);
   53   const char* getValueC_str() const;
   54   void setValue(const IMMSV_OCTET_STRING& in);
   55   void copyValueToEdu(IMMSV_EDU_ATTR_VAL* out, SaImmValueTypeT t) const;
   56   bool empty() const { return !mValueSize; }
   57 
   58  protected:
   59   char* mValue;
   60   unsigned int mValueSize;
   61 };
   62 
   63 class ImmAttrMultiValue : public ImmAttrValue {
   64  public:
   65   ImmAttrMultiValue();
   66   ImmAttrMultiValue(const ImmAttrMultiValue& b);
   67   ImmAttrMultiValue(const ImmAttrValue& b);
   68   virtual ~ImmAttrMultiValue();
   69   virtual bool isMultiValued() const;
   70   virtual unsigned int extraValues() const;
   71   virtual void discardValues();
   72   virtual void print() const;
   73   virtual void removeValue(const IMMSV_OCTET_STRING& match);
   74   virtual bool hasMatchingValue(const IMMSV_OCTET_STRING& match) const;
   75   virtual bool hasDuplicates() const;
   76 
   77   void printMultiValue() const;
   78 
   79   ImmAttrMultiValue& operator=(const ImmAttrMultiValue& b);
   80 
   81   void setExtraValue(const IMMSV_OCTET_STRING& in);
   82   void setExtraValueC_str(const char* str);
   83   void copyExtraValuesToEdu(IMMSV_EDU_ATTR_VAL_LIST** out,
   84                             SaImmValueTypeT t) const;
   85   bool hasExtraValueC_str(const char* str) const;
   86   bool removeExtraValueC_str(const char* str);
   87 
   88   ImmAttrMultiValue* getNextAttrValue() const { return mNext; };
   89 
   90  private:
   91   ImmAttrMultiValue* mNext;  // Singly linked list
   92 };
   93 
   94 #endif  // IMM_IMMND_IMMATTRVALUE_H_