aGrUM  0.14.2
multiDimReadOnly_tpl.h
Go to the documentation of this file.
1 /***************************************************************************
2  * Copyright (C) 2005 by Pierre-Henri WUILLEMIN et Christophe GONZALES *
3  * {prenom.nom}_at_lip6.fr *
4  * *
5  * This program is free software; you can redistribute it and/or modify *
6  * it under the terms of the GNU General Public License as published by *
7  * the Free Software Foundation; either version 2 of the License, or *
8  * (at your option) any later version. *
9  * *
10  * This program is distributed in the hope that it will be useful, *
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13  * GNU General Public License for more details. *
14  * *
15  * You should have received a copy of the GNU General Public License *
16  * along with this program; if not, write to the *
17  * Free Software Foundation, Inc., *
18  * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
19  ***************************************************************************/
27 namespace gum {
28 
29  // Default constructor
30 
31  template < typename GUM_SCALAR >
33  MultiDimImplementation< GUM_SCALAR >() {
34  GUM_CONSTRUCTOR(MultiDimReadOnly);
35  }
36 
37  // Default constructor
38 
39  template < typename GUM_SCALAR >
41  const MultiDimReadOnly< GUM_SCALAR >& from) :
42  MultiDimImplementation< GUM_SCALAR >(from) {
43  GUM_CONS_CPY(MultiDimReadOnly);
44  }
45 
46  // destructor
47 
48  template < typename GUM_SCALAR >
50  GUM_DESTRUCTOR(MultiDimReadOnly);
51  }
52 
53  // @throw OperationNotAllowed Raised because this is a read only table.
54 
55  template < typename GUM_SCALAR >
57  const GUM_SCALAR& value) const {
58  GUM_ERROR(OperationNotAllowed, "Write access to an aggregator");
59  }
60 
61  // @throw OperationNotAllowed Raised because this is a read only table.
62 
63  template < typename GUM_SCALAR >
64  void MultiDimReadOnly< GUM_SCALAR >::fill(const GUM_SCALAR&) const {
65  GUM_ERROR(OperationNotAllowed, "Write access to an aggregator");
66  }
67 
68  // @throw OperationNotAllowed Raised because this is a read only table.
69 
70  template < typename GUM_SCALAR >
72  GUM_ERROR(OperationNotAllowed, "No (unconst) access to an aggregator");
73  }
74 
75 } /* namespace gum */
virtual ~MultiDimReadOnly()
Class destructor.
gum is the global namespace for all aGrUM entities
Definition: agrum.h:25
Abstract base class for all multi dimensionnal read only structure.
virtual GUM_SCALAR & _get(const Instantiation &i) const
virtual void fill(const GUM_SCALAR &) const
Class for assigning/browsing values to tuples of discrete variables.
Definition: instantiation.h:80
MultiDimReadOnly()
Default constructor.
<agrum/multidim/multiDimImplementation.h>
virtual void set(const Instantiation &i, const GUM_SCALAR &value) const
#define GUM_ERROR(type, msg)
Definition: exceptions.h:52