@startuml

class Graph
{
    std::vector<GNode> nodes
    std::vector<Link> links

	+void addNode(GNode *node);
	+void addLink(Link *link);
	+GNode *getNodeByIndex(int index);
	+GNode *getNodeById(int nodeId);
	+Link *getLinkByIndex(int index);
	+Link *getLinkById(int linkId);
	+IGraphNodeIterator *getClassIterator();
	+IGraphNodeIterator *getInterfaceIterator();
	+IGraphLinkIterator *getLinkOfNodeIterator(int nodeId);
	+IGraphLinkIterator *getAllLinkIterator(std::string type = "");
}

class GNode
{
	int _id;
	std::string _type;
	std::string _name;
	std::vector<Attribute *> _attributes;

	int getId();
	void addAttribute(Attribute *attribuite);
	void setType(std::string type);
	std::string getType();
	std::string getName();
	Attribute *getAttribute(int i);
	int attribureCount();
}

class Link
{
    id : int
    label : std::string
    attributes : map<std::string, std::string> ;
    out : int;
    in: int;
}

class Translator
{
    -strategy : GenerationStrategy

    +load()
    -loadClasses()
    -loadInterfaces()
    -loadContent()
    -loadLinks()
    +translate()
    +Translator(GenerationStrategy)
}


class DBDriver
{
    - instance : DBDriver
    + getInstance : DBDriver
    + getNodes() : std::string
    + getLinks() : std::string
}

abstract class GenerationStrategy
{
    + std::string generate(Graph graph)
}

class PlantUMLGenerationStrategy
{
    + std::string generate(Graph graph)
}

abstract IGraphNodeIterator
{
    GNode* begin()
	GNode *getNext()
	bool hasNext()
}

class GraphClassIterator
{
    GNode* begin()
	GNode *getNext()
	bool hasNext()
}
class GraphInterfaceIterator
{
    GNode* begin()
	GNode *getNext()
	bool hasNext()
}

abstract IGraphLinkIterator
{
    Link* begin()
	Link* getNext()
	bool hasNext()
}

class GraphLinkOfNodeIterator
{
    Link* begin()
	Link* getNext()
	bool hasNext()
}

class GraphAllLinkIterator
{
    Link* begin()
	Link* getNext()
	bool hasNext()
}

GraphClassIterator -up-|> IGraphNodeIterator
GraphInterfaceIterator -up-|> IGraphNodeIterator

GraphLinkOfNodeIterator -up-|> IGraphLinkIterator
GraphAllLinkIterator -up-|> IGraphLinkIterator

PlantUMLGenerationStrategy --|> GenerationStrategy

Graph --> GraphClassIterator
Graph --> GraphInterfaceIterator

Graph --> GraphLinkOfNodeIterator
Graph --> GraphAllLinkIterator

Graph o--> GNode
Graph o--> Link

abstract Attribute
{
    _name : std::string
    Kind() : std::string
}

class Method
{
    _returnType : std::string
	_parameters : std::string[]; 
}

Method -up-|> Attribute

class Field
{
    _type : std::string
}

Field -up-|> Attribute

class Constructor
{
	_parameters : std::string[]; 
}

Constructor -up-|> Attribute

GNode o--> Attribute



Translator -- Graph

Translator .left.> DBDriver

GenerationStrategy ..> Graph

Translator -right- GenerationStrategy

Translator -- IGraphNodeIterator

Translator -- IGraphLinkIterator

@enduml