
/*
**  This file forms part of the GOBLIN C++ Class Library.
**
**  Written by Birk Eisermann, August 2003.
**
**  Copying, compiling, distribution and modification
**  of this source code is permitted only in accordance
**  with the GOBLIN general licence information.
*/


#ifndef _SUBGRAPH_H_
#define _SUBGRAPH_H_

#include "abstractSubgraph.h"

/*!
 * \brief concrete %subgraph class
 *@author Birk
 *
 * Dies ist eine allgemeine Implementierung vom Interface abstractMixedSubgraph.
 * Aktualisierung von WithoutGraph fehlt!!
 */

class subgraph : public virtual abstractSubgraph
{
friend class complementarySubgraph;
private:

    abstractMixedGraph* S;              //!<Ursprungsgraph
    abstractSubgraph*   Complement;     //!<SourceGraph ohne diesem Graph
    TNode*              Nodes;
    TArc*               Arcs;
    TNode               Nodes_on_subgraph;
    TArc                Arcs_on_subgraph;

public:
    subgraph(const subgraph *G) throw();
    subgraph(abstractMixedGraph *G) throw();
    virtual ~subgraph() throw();

    //from abstractMixedSubgraph
    virtual abstractMixedGraph* SourceGraph() throw();
    virtual abstractSubgraph* ComplementarySubgraph() throw();
    virtual bool    HasNode(TNode node) throw(ERRange);

    virtual void    AddArc(TArc a) throw(ERRange,ERRejected);
    virtual TArc    AddArc(TNode u,TNode v) throw(ERRange,ERRejected);
    virtual void    AddNode(TNode u) throw(ERRange,ERRejected);
    virtual void    OmitArc(TArc a) throw(ERRange,ERRejected);
    virtual void    OmitArc(TNode u,TNode v) throw(ERRange,ERRejected);
    virtual void    OmitNode(TNode u) throw(ERRange,ERRejected);
    virtual void    OmitIsolatedNodes() throw();


    //from abstractMixedGraph_Int
    virtual TArc    Adjacency(TNode from,TNode to) throw(ERRange);

    virtual TNode   N() throw();
    virtual TArc    M() throw();
    virtual TNode   StartNode(TArc) throw(ERRange);
    virtual TNode   EndNode(TArc) throw(ERRange);
    virtual bool    HasArc(TArc) throw(ERRange);
    virtual TArc    First(TNode) throw(ERRange,ERRejected);
    virtual TArc    Right(TArc,TNode) throw(ERRange,ERRejected);

};

#endif
