Public Types | Public Member Functions | Public Attributes

BookmarkNode Struct Reference

#include <favorites.h>

Collaboration diagram for BookmarkNode:
Collaboration graph
[legend]

List of all members.

Public Types

enum  BOOKMARKNODE_TYPE { BMNT_NONE, BMNT_BOOKMARK, BMNT_FOLDER }

Public Member Functions

 BookmarkNode ()
 BookmarkNode (const Bookmark &bm)
 BookmarkNode (const BookmarkFolder &bmf)
 BookmarkNode (const BookmarkNode &other)
 ~BookmarkNode ()
BookmarkNodeoperator= (const Bookmark &bm)
BookmarkNodeoperator= (const BookmarkFolder &bmf)
BookmarkNodeoperator= (const BookmarkNode &other)
void clear ()

Public Attributes

BOOKMARKNODE_TYPE _type
union {
   Bookmark *   _pbookmark
   BookmarkFolder *   _pfolder
}; 

Detailed Description

Definition at line 49 of file favorites.h.


Member Enumeration Documentation

Enumerator:
BMNT_NONE 
BMNT_BOOKMARK 
BMNT_FOLDER 

Definition at line 64 of file favorites.h.


Constructor & Destructor Documentation

BookmarkNode::BookmarkNode (  )

Definition at line 196 of file favorites.cpp.

References _pbookmark.

 :  _type(BMNT_NONE)
{
    _pbookmark = NULL;
}
BookmarkNode::BookmarkNode ( const Bookmark bm )

Definition at line 202 of file favorites.cpp.

References _pbookmark.

BookmarkNode::BookmarkNode ( const BookmarkFolder bmf )

Definition at line 208 of file favorites.cpp.

References _pfolder.

BookmarkNode::BookmarkNode ( const BookmarkNode other )

Definition at line 214 of file favorites.cpp.

References _pbookmark, _pfolder, _type, BMNT_BOOKMARK, and BMNT_FOLDER.

 :  _type(other._type)
{
    if (other._type == BMNT_BOOKMARK)
        _pbookmark = new Bookmark(*other._pbookmark);
    else if (other._type == BMNT_FOLDER)
        _pfolder = new BookmarkFolder(*other._pfolder);
    else
        _pbookmark = NULL;
}
BookmarkNode::~BookmarkNode (  )

Definition at line 225 of file favorites.cpp.

References _pbookmark, _pfolder, _type, BMNT_BOOKMARK, and BMNT_FOLDER.

{
    if (_type == BMNT_BOOKMARK)
        delete _pbookmark;
    else if (_type == BMNT_FOLDER)
        delete _pfolder;
}

Member Function Documentation

void BookmarkNode::clear (  )

Definition at line 265 of file favorites.cpp.

References _pbookmark, _pfolder, _type, BMNT_BOOKMARK, BMNT_FOLDER, and BMNT_NONE.

Referenced by operator=().

{
    if (_type == BMNT_BOOKMARK) {
        delete _pbookmark;
        _pbookmark = NULL;
    }
    else if (_type == BMNT_FOLDER) {
        delete _pfolder;
        _pfolder = NULL;
    }

    _type = BMNT_NONE;
}

Here is the caller graph for this function:

BookmarkNode & BookmarkNode::operator= ( const BookmarkFolder bmf )

Definition at line 242 of file favorites.cpp.

References _pfolder, and clear().

{
    clear();

    _pfolder = new BookmarkFolder(bmf);

    return *this;
}

Here is the call graph for this function:

BookmarkNode & BookmarkNode::operator= ( const BookmarkNode other )

Definition at line 251 of file favorites.cpp.

References _pbookmark, _pfolder, _type, BMNT_BOOKMARK, BMNT_FOLDER, and clear().

{
    clear();

    _type = other._type;

    if (other._type == BMNT_BOOKMARK)
        _pbookmark = new Bookmark(*other._pbookmark);
    else if (other._type == BMNT_FOLDER)
        _pfolder = new BookmarkFolder(*other._pfolder);

    return *this;
}

Here is the call graph for this function:

BookmarkNode & BookmarkNode::operator= ( const Bookmark bm )

Definition at line 233 of file favorites.cpp.

References _pbookmark, and clear().

{
    clear();

    _pbookmark = new Bookmark(bm);

    return *this;
}

Here is the call graph for this function:


Member Data Documentation

union { ... }

The documentation for this struct was generated from the following files:

ROS Explorer Source Code Documentation
generated on 02.01.2013 by doxygen

ROS Explorer Homepage