VIZ++ Class: ListEntryT

 VIZ++ Class Library  VIZ++ Samples  VIZ++ ClassTree 

Source code

/*
 * ListEntryT.h 
 * Copyright (c) 2015 Antillia.com TOSHIYUKI ARAI. ALL RIGHTS RESERVED. 
 */


#pragma once

#include <viz++/EntryT.h>


namespace VIZ {

template <class T> class ListEntryT :public EntryT<T> {

private:
  ListEntryT*  prev;  
  ListEntryT*  next;

public:
  ListEntryT(T* object)
    :EntryT<T>(object),
    prev(NULL), next(NULL) {
    //
  }

  ListEntryT(T* object, ListEntryT* nxt)
    :EntryT<T>(object),
    prev(NULL), next(nxt) {
    //
  }
  
  ListEntryT(T* object, ListEntryT* pre, ListEntryT* nxt)
    :EntryT<T>(object),
    prev(pre), next(nxt) {
    //
  }

  ~ListEntryT() {
      T* object = EntryT<T>::getObject();
      if (object) {
        delete object;
      }
  }

  void  setPrev(ListEntryT* entry) {
      prev = entry;
  }

  void  setNext(ListEntryT* entry) {
      next = entry;
  }

  ListEntryT*  getPrev() { 
      return  prev;
  }

  ListEntryT*  getNext() { 
      return  next;
  }
};

}



Last modified: 10 Feb 2017

Copyright (c) 2009-2017 Antillia.com ALL RIGHTS RESERVED.