Baigudin Software avatar
Baigudin Software logo
home
ru region
en region

PHP DOM Builder is unveiled in second revision

In 2014 year PHP DOM Builder library was unveiled at the first time within the framework of Baigudin Software project. Two years have been left after that moment and today we are glad to offer the second generation that is PHP DOM Builder Revision 2.

Class «util::LinkedNode<Type,Alloc>»

Element for linked lists.

Parameters:
Type — data type of element.
Alloc = Allocator — heap memory allocator class.

public:


                                           LinkedNode(const Type& element);

 virtual                                  ~LinkedNode();

 virtual void                              after(::util::LinkedNode<Type,Alloc>* node);

 virtual void                              before(::util::LinkedNode<Type,Alloc>* node);

 virtual Type                              element() const;

 virtual int32                             index() const;

 virtual bool                              isConstructed() const;

 static bool                               isObject(const Type* obj);

 virtual ::util::LinkedNode<Type,Alloc>*   next() const;

 void                                      operator delete(void* ptr);

 void*                                     operator new(size_t size);

 void*                                     operator new(size_t size, void* ptr);

 virtual ::util::LinkedNode<Type,Alloc>*   prev() const;


protected:


 static Type                               alloc(size_t size);

 static void                               free(void* ptr);

 virtual void                              setConstruct(bool flag);

public: LinkedNode(const Type& element);

Constructor.

Given element will be copied to self nodes structure by a copy constructor calling.

Parameters:
element — an user element of this node.

public: virtual ~LinkedNode();

Destructor.

public: virtual void after(::util::LinkedNode<Type,Alloc>* node);

Inserts a new element after this.

Method links a node after this and reindexes chain of nodes starts from given node.

Parameters:
node — pointer to inserted node.

public: virtual void before(::util::LinkedNode<Type,Alloc>* node);

Inserts a new element after this.

Method links a node before this and reindexes chain of nodes starts from this node.

Parameters:
node — pointer to inserted node.

public: virtual Type element() const;

Returns the element.

Returns:
next element.

public: virtual int32 index() const;

Returns the element index.

Returns:
element index.

public: virtual bool isConstructed() const;

Tests if this object has been constructed.

Returns:
true if object has been constructed successfully.

public: static bool isObject(const Type* obj);

Tests if given object has been constructed object.

Parameters:
obj — pointer to object.

Returns:
true if object has been constructed successfully.

public: virtual ::util::LinkedNode<Type,Alloc>* next() const;

Returns next element.

Returns:
next element.

public: void operator delete(void* ptr);

Operator delete.

Parameters:
ptr — address of allocated memory block or a null pointer.

public: void* operator new(size_t size);

Operator new.

Parameters:
size — number of bytes to allocate.

Returns:
allocated memory address or a null pointer.

public: void* operator new(size_t size, void* ptr);

Operator new.

Parameters:
size — unused.
ptr — pointer to reserved memory area

Returns:
given pointer.

public: virtual ::util::LinkedNode<Type,Alloc>* prev() const;

Returns previous element.

Returns:
previous element.

protected: static Type alloc(size_t size);

Allocates memory.

Parameters:
size — number of bytes to allocate.

Returns:
allocated memory address or a null pointer.

protected: static void free(void* ptr);

Frees an allocated memory.

Parameters:
ptr — address of allocated memory block or a null pointer.

protected: virtual void setConstruct(bool flag);

Sets the object constructed flag.

Parameters:
flag — constructed flag.

Back to class list