![]() |
Bridges-C++
3.1.1
Bridges(C++API)
|
#include <MLelement.h>
This class can be used to instantiate Multi-list Elements.
This class extends SLelement (singly linked list element) to build multi-lists; Multilist elements contain a tag (boolean) that indicates if the element contains a sublist or not; if the tag is true, then there is a sublist beginning at this node and the starting point is the `sublist' field in the element. If the tag is false, then the list continues as a normal singly linked list. The sublists are re recursive: any sublist can have its own sublists and so on. As in singly linked elements, the next pointer points to the following list element and each element contains a generic application specific object.
Multi-list elements contain a visualizer (ElementVisualizer) object for setting visual attributes (color, shape, opacity, size), necessary for displaying them in a web browser.
Elements also have a LinkVisualizer object, that is used when they are linked to another element, appropriate for setting link attributes, for instance, between the current element and its next element. In this case, the link in question is that which connects the element to the following elements; a similar logic follows for sublists.
| E | The generic parameter object that is part of this element, representing either application specific data, or a pointer to a sublist. |
Public Member Functions | |
| MLelement (const E &val=E(), const string &lab=string()) | |
| MLelement (string label) | |
| MLelement (E e, MLelement< E > *next) | |
| void | setSubList (MLelement< E > *sl) |
| MLelement * | getSubList () |
| MLelement< E > * | getNext () override |
| MLelement< E > * | getNext () const override |
| void | setNext (MLelement< E > *n) |
| void | setTag (bool t) |
| Sets the tag of the element. More... | |
| bool | getTag () |
| Gets the tag of the element. More... | |
| virtual const string | getDStype () const override |
Public Member Functions inherited from bridges::datastructure::SLelement< E > | |
| SLelement (SLelement *next, const E &val=E(), const string &lab=string()) | |
| SLelement (const E &val=E(), const string &lab=string()) | |
| void | setNext (SLelement *n) |
Public Member Functions inherited from bridges::datastructure::Element< E > | |
| Element (const E &val=E(), const string &lab=string()) | |
| Element (const Element &e) | |
| Element & | operator= (const Element &e) |
| E & | operator= (E const &e) |
| virtual | ~Element () |
| ElementVisualizer * | getVisualizer () |
| const ElementVisualizer * | getVisualizer () const |
| LinkVisualizer * | getLinkVisualizer (const Element *el) |
| LinkVisualizer * | getLinkVisualizer (const Element *el) const |
| string const & | getLabel () const |
| void | setLabel (const string &lab) |
| E const & | getValue () const |
| E & | getValue () |
| void | setValue (const E &val) |
| void | setSize (const double &sz) |
| Sets size of the element. More... | |
| double | getSize () const |
| void | setColor (const Color &col) |
| Set the color of the Element. More... | |
| void | setColor (const string col) |
| Set the color by name. More... | |
| Color | getColor () const |
| Get the current color of the element. More... | |
| void | setOpacity (double opacity) |
| double | getOpacity () |
| void | setShape (const Shape &shp) |
| Set the shape of the element. More... | |
| Shape | getShape () const |
| Returns the shape of the element. More... | |
| void | setLocation (const double &locX, const double &locY) |
| double | getLocationX () const |
| double | getLocationY () const |
Public Member Functions inherited from bridges::datastructure::DataStructure | |
| virtual | ~DataStructure ()=default |
Protected Attributes | |
| MLelement< E > * | sub_list = nullptr |
| bool | tag = false |
Protected Attributes inherited from bridges::datastructure::SLelement< E > | |
| SLelement * | next = nullptr |
Protected Attributes inherited from bridges::datastructure::Element< E > | |
| unordered_map< Element *, LinkVisualizer > | links |
Additional Inherited Members | |
Protected Member Functions inherited from bridges::datastructure::SLelement< E > | |
| virtual const pair< string, string > | generateJSON (vector< const SLelement< E > *> nodes) const |
| virtual void | getListElements (vector< const SLelement< E > *> &nodes) const |
Protected Member Functions inherited from bridges::datastructure::Element< E > | |
| virtual const string | getElementRepresentation () const |
Static Protected Member Functions inherited from bridges::datastructure::Element< E > | |
| static const string | getLinkRepresentation (const LinkVisualizer &lv, const string &src, const string &dest) |
|
inline |
This constructor creates an MLelement object and sets the next pointer to null
| val | generic object |
| lab | label |
|
inline |
|
inline |
Creates a new element with value "e" and sets the next pointer to the MLelement referenced by the "next" argument
| e | the generic object that this element will hold |
| next | the element that should be assigned to the next pointer |
|
inlineoverridevirtual |
Reimplemented from bridges::datastructure::SLelement< E >.
|
inlineoverridevirtual |
Retrieves the element following this element
Reimplemented from bridges::datastructure::SLelement< E >.
|
inlineoverridevirtual |
Retrieves the element following this element - const version
Reimplemented from bridges::datastructure::SLelement< E >.
|
inline |
Gets the sublist at this node, if it exists
|
inline |
Gets the tag of the element.
|
inline |
Sets the element to point to the next MLelement
| n | MLelement<E> that should be assigned to the next pointer |
|
inline |
|
inline |
Sets the tag of the element.
| t | tag to set |
|
protected |
|
protected |
1.8.13