/* This software is distributed under the Lesser General Public License */
#ifndef GT_LIST_OF_ATTRIBUTES_H
#define GT_LIST_OF_ATTRIBUTES_H

//
// List_of_Attributes.h
//
// This file defines the classes
//   GT_List_of_Attributes
//
//------------------------------------------ CVS
//
// CVS Headers -- The following headers are generated by the CVS
// version control system. Note that especially the attribute
// Author is not necessarily the author of the code.
//
// $source: /home/br/CVS/graphlet/src/gt_base/Attributes.h,v $
// $Author: himsolt $
// $Revision: 1.2 $
// $Date: 1999/03/05 20:44:19 $
// $Locker:  $
// $State: Exp $
//
//------------------------------------------ CVS
//
// (C) University of Passau 1995-1999, Graphlet Project
//


#include <list>

#ifndef GT_ATTRIBUTE_BASE_H
#include "Attribute_Base.h"
#endif


//////////////////////////////////////////
//
// list<GT_Attribute_Base*> Attributes
//
//////////////////////////////////////////


class GT_List_of_Attributes : public list<GT_Attribute_Base*> {

    GT_BASE_CLASS (GT_List_of_Attributes);
    
public:
	
    GT_List_of_Attributes ();
    virtual ~GT_List_of_Attributes ();

    // virtual copy constructor
    void copy (const GT_List_of_Attributes* from, GT_Copy type);
    virtual GT_List_of_Attributes* clone (GT_Copy type) const;
    virtual void update_from_parent (GT_Copy type);

    // search & find
    const_iterator find (const GT_Key key) const;
    iterator find (const GT_Key key);

    bool extract (const GT_Key key, int& value);
    bool extract (const GT_Key key, bool& value);
    bool extract (const GT_Key key, double& value);
    bool extract (const GT_Key key, string& value);
    bool extract (const GT_Key key, GT_Key& value);
    bool extract (const GT_Key key, GT_List_of_Attributes*& value);

//     bool extract (const GT_Key key, node& value);
//     bool extract (const GT_Key key, edge& value);
//     bool extract (const GT_Key key, list<node>& value);
//     bool extract (const GT_Key key, list<edge>& value);

    const_iterator find (const GT_Key key, int& value) const;
    const_iterator find (const GT_Key key, bool& value) const;
    const_iterator find (const GT_Key key, double& value) const;
    const_iterator find (const GT_Key key, string& value) const;
    const_iterator find (const GT_Key key, GT_Key& value) const;
    const_iterator find (const GT_Key key,
	GT_List_of_Attributes*& value) const;

    // Printing optimization: print only if you must
    static void print_list_head (ostream& out, const GT_Key key);
    virtual void print (ostream& out) const;
    static void print_list_tail (ostream& out);
    virtual bool do_print () const;

    // Value extraction (generic)
    virtual int extract (GT_List_of_Attributes* current_list,
	string& message);    
};


extern void GT_print (ostream &out, const GT_List_of_Attributes* attrs_list);

#endif
