Skip to content

Latest commit

 

History

History
108 lines (64 loc) · 2.59 KB

Document.md

File metadata and controls

108 lines (64 loc) · 2.59 KB

Document

template<typename Alloc>
class BasicDocument

Inherited from: ObjectNode.

Required header: <Eclog/Document.h>

The BasicDocument class is an in-memory representation of an Eclog text for accessing and modifying; it consists of a tree-structured collection of nodes (See Node), which is called a document tree.

A typedef for the default allocator is provided:

typedef BasicDocument<ECLOG_DEFAULT_ALLOCATOR> Document;

Template parameters

Alloc Allocator type used to allocate internal storage.


Member functions

Name Description
(constructor) Constructor.
operator= Assigns new elements to this document, replacing its current elements.
swap Exchanges the elements of this document with another document.

(constructor)

BasicDocument();                                                    (1)
BasicDocument(const ObjectDesc& desc);                              (2)
BasicDocument(const ObjectNode& other);                             (3)
BasicDocument(const BasicDocument& other);                          (4)

Constructs a Document.

(1) Default constructor. Constructs empty document.

(2) Constructs the document with an object description.

(3) Constructs the document with an object node.

(4) Copy constructor.

Parameters

const ObjectDesc& desc An object description.

const ObjectNode& other Another object.

const BasicDocument& other Another document.


operator=

BasicDocument& operator=(const ObjectDesc& desc);
BasicDocument& operator=(const ObjectNode& other);
BasicDocument& operator=(const BasicDocument& other);

Assigns new elements to this document, replacing its current elements.

Parameters

const ObjectDesc& desc An object description.

const ObjectNode& other Another object.

const BasicDocument& other Another document.

Errors

If an error occurs, this document remains untouched.

Iterator validity

All iterators related to this object are invalidated, except the end iterators.

Complexity

Linear in the number of elements to be removed and to be copied.


swap

void swap(BasicDocument& other);

Exchanges the elements of the document with another document.

Parameters

BasicDocument& other Another document.