class libfwbuilder::FWObject

This class represents base class for all objects we are dealing with.

Inheritance:


Public Methods

[more] DECLARE_FWOBJECT_SUBTYPE(FWObject)
[more]virtual void fromXML(xmlNodePtr xml_parent_node)
[more]virtual xmlNodePtr toXML(xmlNodePtr xml_parent_node)
[more]void setXMLName(const string &)
Rarely used feature: we can change the name of XML element represented by the class derived from FWObject if we want to.
[more]virtual ~FWObject()
[more]int ref()
[more]int unref()
[more]virtual FWObject& operator=(const FWObject &)
This method copies content of object 'x' to object 'this', including ID.
[more]virtual FWObject& duplicate(const FWObject* obj)
this method copies content of object 'x' in the object 'this' preserving object's 'this' ID
[more]void Show()
[more]void Hide()
[more]FWObject* getParent()
[more]void setParent(FWObject* p)
[more]bool exists(const string &name) const
[more]void remStr(const string &name)
[more]const string& getStr(const string& name) const
[more]void setStr(const string &name, const string &val)
[more]int getInt(const string &name) const
[more]void setInt(const string &name, int val)
[more]bool getBool(const string &name) const
[more]void setBool(const string &name, bool val)
[more]void setBool(const string &name, const string &val)
[more]const string& getName() const
[more]void setName(const string& n)
[more]const string& getComment() const
[more]void setComment(const string& c)
[more]const string& getLibrary() const
[more]void setLibrary(const string& c)
[more]const string& getId() const
[more]void setId(const string& c)
[more]void addAt(const string& where_id, FWObject* obj)
[more]virtual void add(FWObject* obj)
[more]virtual void insert_before(FWObject* o1, FWObject* obj)
[more]virtual void insert_after(FWObject* o1, FWObject* obj)
[more]virtual void swapObjects(FWObject* o1, FWObject* o2)
In direct children of 'this' swaps all references to o1 with o2 and vice versa
[more]virtual bool GUISortOrder(const FWObject* a, const FWObject* b)
[more]virtual void sortChildren()
[more]virtual void remove(FWObject* obj, bool delete_if_last=true)
Finds first instance of 'obj' in children of this object and removes if.
[more]virtual void removeAllInstances(FWObject* obj)
Finds and removes instances of 'obj' recursively in the whole tree under this object
[more]virtual void addRef(FWObject* obj)
Adds reference object pointing to 'obj' as a child of 'this'
[more]virtual void removeRef(FWObject* obj)
Removes reference to given object among children of 'this'
[more]virtual void removeAllReferences(FWObject* obj)
Removes all references to 'obj' recursively in the whole tree under 'this'
[more]virtual FWReference* createRef( FWObject* obj )
[more]virtual bool validateChild(FWObject* o)
[more]void clearChildren()
[more]void clearChildren(const string &type_name)
[more]int getChildrenCount()
[more]virtual void dump(bool recursive, bool brief, int offset=0)
[more]virtual void dump(std::ofstream &f, bool recursive, bool brief, int offset=0)
[more]FWObject* getRoot()
Returns root of the objects tree this object is part of
[more]virtual FWObject* getById(const string &id, bool recursive=false, bool dereference=false)
Returns object with given ID.
[more]virtual vector<FWObject*> getByType(const string &type_name)
Returns list of direct children of current object whose getTypeName() same as given.
[more]virtual FWObject* getFirstByType(const string &type_name)
Returns first of direct children of current object whose getTypeName() same as given or NULL if not found
[more]void setDirty(bool f, bool recursive=false)
[more]bool isDirty(bool recursive)
[more]map<string, string> ::iterator dataBegin()
[more]map<string, string> ::iterator dataEnd()

Protected Fields

[more]string xml_name
[more]map<string, string> data

Protected Methods

[more]void _adopt(FWObject* obj)
[more]FWObject* _find(const string& name)
Finds direct child of this object with given name
[more] FWObject()
[more] FWObject(FWObject &copy)
[more] FWObject(FWObject* parent)


Documentation

This class represents base class for all objects we are dealing with.

FWObject can have children, that is other objects of the same class or derived classes which are included in this one

ostring xml_name

omap<string, string> data

ovoid _adopt(FWObject* obj)

oFWObject* _find(const string& name)
Finds direct child of this object with given name

o FWObject()

o FWObject(FWObject &copy)

o FWObject(FWObject* parent)

o DECLARE_FWOBJECT_SUBTYPE(FWObject)

ovirtual void fromXML(xmlNodePtr xml_parent_node)

ovirtual xmlNodePtr toXML(xmlNodePtr xml_parent_node)

ovoid setXMLName(const string &)
Rarely used feature: we can change the name of XML element represented by the class derived from FWObject if we want to. For example, used in all "Any" objects so we did not have to create extra classes

ovirtual ~FWObject()

oint ref()

oint unref()

ovirtual FWObject& operator=(const FWObject &)
This method copies content of object 'x' to object 'this', including ID. Resultant object is identical copy of 'x'. This is mostly used for creating scratchpad copies

ovirtual FWObject& duplicate(const FWObject* obj)
this method copies content of object 'x' in the object 'this' preserving object's 'this' ID

Thus, what we get in the end is still unique object, but its content is the same as that of the object 'x'

ovoid Show()

ovoid Hide()

oFWObject* getParent()

ovoid setParent(FWObject* p)

obool exists(const string &name) const

ovoid remStr(const string &name)

oconst string& getStr(const string& name) const

ovoid setStr(const string &name, const string &val)

oint getInt(const string &name) const

ovoid setInt(const string &name, int val)

obool getBool(const string &name) const

ovoid setBool(const string &name, bool val)

ovoid setBool(const string &name, const string &val)

oconst string& getName() const

ovoid setName(const string& n)

oconst string& getComment() const

ovoid setComment(const string& c)

oconst string& getLibrary() const

ovoid setLibrary(const string& c)

oconst string& getId() const

ovoid setId(const string& c)

ovoid addAt(const string& where_id, FWObject* obj)

ovirtual void add(FWObject* obj)

ovirtual void insert_before(FWObject* o1, FWObject* obj)

ovirtual void insert_after(FWObject* o1, FWObject* obj)

ovirtual void swapObjects(FWObject* o1, FWObject* o2)
In direct children of 'this' swaps all references to o1 with o2 and vice versa

ovirtual bool GUISortOrder(const FWObject* a, const FWObject* b)

ovirtual void sortChildren()

ovirtual void remove(FWObject* obj, bool delete_if_last=true)
Finds first instance of 'obj' in children of this object and removes if. If 'obj' reference counter reaches 0 it is also deleted.

ovirtual void removeAllInstances(FWObject* obj)
Finds and removes instances of 'obj' recursively in the whole tree under this object

ovirtual void addRef(FWObject* obj)
Adds reference object pointing to 'obj' as a child of 'this'

ovirtual void removeRef(FWObject* obj)
Removes reference to given object among children of 'this'

ovirtual void removeAllReferences(FWObject* obj)
Removes all references to 'obj' recursively in the whole tree under 'this'

ovirtual FWReference* createRef( FWObject* obj )

ovirtual bool validateChild(FWObject* o)

ovoid clearChildren()

ovoid clearChildren(const string &type_name)

oint getChildrenCount()

ovirtual void dump(bool recursive, bool brief, int offset=0)

ovirtual void dump(std::ofstream &f, bool recursive, bool brief, int offset=0)

oFWObject* getRoot()
Returns root of the objects tree this object is part of

ovirtual FWObject* getById(const string &id, bool recursive=false, bool dereference=false)
Returns object with given ID. If recursive is 'false' search is restricted to direct children of given object and itslef. If it is true, method proceeds to all chidren of all objects starting from current one.

If dereference is 'false', references are treated as regular objects (that is, ID of FWReference object itself is compared with id). If dereference is 'true' then ID of the object pointed at by the reference is compared with id

ovirtual vector<FWObject*> getByType(const string &type_name)
Returns list of direct children of current object whose getTypeName() same as given. If not found, empty list is returned.

ovirtual FWObject* getFirstByType(const string &type_name)
Returns first of direct children of current object whose getTypeName() same as given or NULL if not found

ovoid setDirty(bool f, bool recursive=false)

obool isDirty(bool recursive)

omap<string, string> ::iterator dataBegin()

omap<string, string> ::iterator dataEnd()


Direct child classes:
UDPService
TCPService
RuleSet
RuleElement
Network
Interval
Interface
IPService
ICMPService
Host
Group
FWReference
FWOptions
FWObjectDatabase
CustomService

Alphabetic index HTML hierarchy of classes or Java



This page was generated with the help of DOC++.