Public Types | Public Member Functions | Public Attributes | Protected Attributes | Friends

ACEXML_Element_Tree_List_Node Class Reference

An abstract base class for describing a node list in a DTD child element definition. More...

#include <parser/debug_validator/Element_Tree.h>

Inheritance diagram for ACEXML_Element_Tree_List_Node:
Inheritance graph
[legend]
Collaboration diagram for ACEXML_Element_Tree_List_Node:
Collaboration graph
[legend]

List of all members.

Public Types

enum  LIST_TYPE { SEQUENCE, CHOICE }

Public Member Functions

 ACEXML_Element_Tree_List_Node (void)
 Default constructor.
virtual ~ACEXML_Element_Tree_List_Node (void)
 Destructor.
int insert (ACEXML_Element_Tree_Node *node)
 Insert a new ACEXML_Element_Tree_Node into the list.
LIST_TYPE get (void)
 Get/set the type of list.
int set (LIST_TYPE type)
virtual void dump ()
 Displaying the content.

Public Attributes

 ACE_ALLOC_HOOK_DECLARE

Protected Attributes

LIST_TYPE type_
ACEXML_Element_Tree_Nodehead_
ACEXML_Element_Tree_Nodetail_
ACEXML_Element_Tree_List_Nodepop_next_

Friends

class ACEXML_Element_Tree_List_Stack

Detailed Description

An abstract base class for describing a node list in a DTD child element definition.

See also:
ACEXML_Element_Tree_Node, ACEXML_Element_Tree_Name_Node

Definition at line 91 of file Element_Tree.h.


Member Enumeration Documentation

Enumerator:
SEQUENCE 
CHOICE 

Definition at line 97 of file Element_Tree.h.

               {
    SEQUENCE,
    CHOICE
  } LIST_TYPE;


Constructor & Destructor Documentation

ACEXML_INLINE ACEXML_Element_Tree_List_Node::ACEXML_Element_Tree_List_Node ( void   ) 

Default constructor.

Definition at line 36 of file Element_Tree.inl.

  : type_ (SEQUENCE),
    head_ (0),
    tail_ (0),
    pop_next_ (0)
{
}

ACEXML_Element_Tree_List_Node::~ACEXML_Element_Tree_List_Node ( void   )  [virtual]

Destructor.

Definition at line 24 of file Element_Tree.cpp.

{
  delete this->head_;
}


Member Function Documentation

void ACEXML_Element_Tree_List_Node::dump (  )  [virtual]

Displaying the content.

Implements ACEXML_Element_Tree_Node.

Definition at line 45 of file Element_Tree.cpp.

{
  ACEXML_Element_Tree_Node *ptr = this->head_;
  const ACEXML_Char *separator = (this->type_ == SEQUENCE) ? ACE_TEXT(" , ") : ACE_TEXT(" | ");

  cout << "(";

  if (ptr != 0)
    {
      ptr->dump ();
      ptr = ptr->next ();

      while (ptr != 0)
        {
          cout << separator;
          ptr->dump ();
          ptr->next ();
        }
    }

  cout << ")";
}

ACEXML_INLINE ACEXML_Element_Tree_List_Node::LIST_TYPE ACEXML_Element_Tree_List_Node::get ( void   ) 

Get/set the type of list.

Definition at line 45 of file Element_Tree.inl.

{
  return this->type_;
}

int ACEXML_Element_Tree_List_Node::insert ( ACEXML_Element_Tree_Node node  ) 

Insert a new ACEXML_Element_Tree_Node into the list.

Definition at line 30 of file Element_Tree.cpp.

{
  if (this->head_ == 0)
    {
      this->tail_ = this->head_ = node;
    }
  else
    {
      this->tail_->next (node);
      this->tail_ = node;
    }
  return 0;
}

ACEXML_INLINE int ACEXML_Element_Tree_List_Node::set ( ACEXML_Element_Tree_List_Node::LIST_TYPE  type  ) 

Definition at line 51 of file Element_Tree.inl.

{
  this->type_ = type;
  return 0;
}


Friends And Related Function Documentation

friend class ACEXML_Element_Tree_List_Stack [friend]

Definition at line 95 of file Element_Tree.h.


Member Data Documentation

Reimplemented from ACEXML_Element_Tree_Node.

Definition at line 117 of file Element_Tree.h.

Definition at line 121 of file Element_Tree.h.

Definition at line 125 of file Element_Tree.h.

Definition at line 123 of file Element_Tree.h.

Definition at line 119 of file Element_Tree.h.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines