Skip to content
Snippets Groups Projects
EmptyElementData.h 2.31 KiB
Newer Older
// ============================================================================
// ==                                                                        ==
// == AMDiS - Adaptive multidimensional simulations                          ==
// ==                                                                        ==
// ==                                                                        ==
// ============================================================================
//
// Software License for AMDiS
//
// Copyright (c) 2010 Dresden University of Technology 
// All rights reserved.
// Authors: Simon Vey, Thomas Witkowski et al.
//
// This file is part of AMDiS
//
// See also license.opensource.txt in the distribution.



/** \file EmptyElementData.h */

#ifndef AMDIS_EMPTYELEMENTDATA_H
#define AMDIS_EMPTYELEMENTDATA_H

#include "Element.h"
#include "ElementData.h"
#include "FixVec.h"

namespace AMDiS {

  const int EMPTY_ED = 6;

  class EmptyElementData : public ElementData
  {
  public:
    inline bool isOfType(int typeID) const 
    {
      if (typeID == EMPTY_ED) 
	return true;
      return false;

    class Creator : public CreatorInterface<ElementData>
    {
    public:
Thomas Witkowski's avatar
Thomas Witkowski committed
      ElementData* create() 
      {
Thomas Witkowski's avatar
Thomas Witkowski committed
	return new EmptyElementData;
    };

    EmptyElementData(ElementData *decorated = NULL)
      : ElementData(decorated)

    bool refineElementData(Element* parent, 
			   Element* child1,
			   Element* child2,
			   int elType)
    {
      ElementData::refineElementData(parent, child1, child2, elType);
Thomas Witkowski's avatar
Thomas Witkowski committed
      child1->setElementData(new EmptyElementData(child1->getElementData()));
      child2->setElementData(new EmptyElementData(child2->getElementData()));
Thomas Witkowski's avatar
Thomas Witkowski committed
    ElementData *clone() const 
    { 
Thomas Witkowski's avatar
Thomas Witkowski committed
      EmptyElementData *newObj = new EmptyElementData;
      newObj->decorated_ = ElementData::clone();
      return newObj; 
Thomas Witkowski's avatar
Thomas Witkowski committed
    inline std::string getTypeName() const 
    { 
      return "EmptyElementData"; 
    }
Thomas Witkowski's avatar
Thomas Witkowski committed
    inline const int getTypeID() const 
    { 
      return EMPTY_ED; 
    }
    void serialize(std::ostream& out) 
    {
      ElementData::serialize(out);
    void deserialize(std::istream& in) 
    {
      ElementData::deserialize(in);