"Fossies" - the Fresh Open Source Software Archive

Member "ivtools-ivtools-2.0.4/src/Attribute/attribute.h" (9 Oct 2020, 2679 Bytes) of package /linux/misc/ivtools-ivtools-2.0.4.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 "attribute.h" see the Fossies "Dox" file reference documentation.

    1 /*
    2  * Copyright (c) 1996,1999 Vectaport Inc.
    3  *
    4  * Permission to use, copy, modify, distribute, and sell this software and
    5  * its documentation for any purpose is hereby granted without fee, provided
    6  * that the above copyright notice appear in all copies and that both that
    7  * copyright notice and this permission notice appear in supporting
    8  * documentation, and that the names of the copyright holders not be used in
    9  * advertising or publicity pertaining to distribution of the software
   10  * without specific, written prior permission.  The copyright holders make
   11  * no representations about the suitability of this software for any purpose.
   12  * It is provided "as is" without express or implied warranty.
   13  *
   14  * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
   15  * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS.
   16  * IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL,
   17  * INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
   18  * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
   19  * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
   20  * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
   21  * 
   22  */
   23 
   24 #ifndef _attribute_h
   25 #define _attribute_h
   26 
   27 #include <Attribute/classid.h>
   28 #include <InterViews/resource.h>
   29 
   30 class AttributeValue;
   31 class AttributeList;
   32 
   33 //: generic symbol/value pair.
   34 // Attribute consists of a symbol, represented by its index into a symbol table,
   35 // paired with a value, represented by an AttributeValue.  Memory for the
   36 // AttributeValue is owned by the Attribute.
   37 class Attribute : public Resource {
   38 public:
   39     Attribute(const char* name =0, AttributeValue* value =0);
   40     // construct an attribute by generating a symbol id for the 'name'
   41     // character string, and accepting a pointer to an externally allocated 'value'.
   42     Attribute(int symid, AttributeValue* value =0);
   43     // construct an attribute with a symbol id instead of a character string, 
   44     // and accepting a pointer to an externally allocated 'value'.
   45 
   46     Attribute(const Attribute&);
   47     // copy constructor.
   48 
   49     virtual ~Attribute();
   50     // deallocate memory for internal AttributeValue.
   51 
   52     const char* Name();
   53     // look up and return symbol string.
   54     void Value(AttributeValue*);
   55     // accept new pointer to an externally allocated AttributeValue,
   56     // deleting the old pointer.
   57     AttributeValue* Value();
   58     // return a pointer to the internal AttributeValue.
   59     int SymbolId();
   60     // return the id of the symbol in the symbol table.
   61 
   62 protected:
   63     int symbolid;
   64     AttributeValue* valueptr;
   65 
   66 friend class AttributeList;
   67 
   68     CLASS_SYMID("Attribute"); 
   69 };
   70 
   71 #endif