Memosa-FVM  0.2
IContainer.h
Go to the documentation of this file.
1 // This file os part of FVM
2 // Copyright (c) 2012 FVM Authors
3 // See LICENSE file for terms.
4 
5 #ifndef _ICONTAINER_H_
6 #define _ICONTAINER_H_
7 
8 #include "misc.h"
9 #include "RLogInterface.h"
10 #include "CException.h"
11 
13 {
14 public:
15 
17  virtual ~IContainer() {}
18 
19  virtual void zero() =0;
20 
21  // implement operator= in terms of the copyFrom virtual function
22  // rather than making it a pure virtual because assignment is always
23  // defined in each derived class and we would need to override all versions
24 
26  {
27  copyFrom(oc);
28  return *this;
29  }
30 
31  virtual shared_ptr<IContainer> newCopy() const = 0;
32  virtual shared_ptr<IContainer> newClone() const = 0;
33 
34  virtual void copyFrom(const IContainer& oc) = 0;
35 private:
36  IContainer(const IContainer&);
37 };
38 
39 #endif
virtual ~IContainer()
Definition: IContainer.h:17
IContainer & operator=(const IContainer &oc)
Definition: IContainer.h:25
virtual void copyFrom(const IContainer &oc)=0
virtual void zero()=0
virtual shared_ptr< IContainer > newClone() const =0
virtual shared_ptr< IContainer > newCopy() const =0