xc
ActionWeightingMap.h
1 // -*-c++-*-
2 //----------------------------------------------------------------------------
3 // xc utils library; general purpose classes and functions.
4 //
5 // Copyright (C) Luis C. Pérez Tato
6 //
7 // XC utils is free software: you can redistribute it and/or modify
8 // it under the terms of the GNU General Public License as published by
9 // the Free Software Foundation, either version 3 of the License, or
10 // (at your option) any later version.
11 //
12 // This software is distributed in the hope that it will be useful, but
13 // WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 // GNU General Public License for more details.
16 //
17 // You should have received a copy of the GNU General Public License
18 // along with this program.
19 // If not, see <http://www.gnu.org/licenses/>.
20 //----------------------------------------------------------------------------
21 //ActionWeightingMap.h
22 //Container for actions and corresponding factors.
23 
24 #ifndef ACTIONWEIGHTINGMAP_H
25 #define ACTIONWEIGHTINGMAP_H
26 
27 #include "utility/kernel/CommandEntity.h"
28 #include "utility/load_combinations/actions/factors/Factors.h"
29 #include <map>
30 
31 
32 namespace cmb_acc {
33 
34 class Action;
35 class ActionWrapper;
36 class ActionsAndFactors;
37 class LoadCombinations;
38 
40 //
43  {
44  public:
45  typedef std::map<std::string,ActionsAndFactors *> map_actions_and_factors;
46  typedef map_actions_and_factors::iterator iterator;
47  typedef map_actions_and_factors::const_iterator const_iterator;
48 
49  private:
50  map_actions_and_factors actions_and_factors;
51 
52  bool exists(const std::string &nmb) const;
53  ActionsAndFactors *findOrCreate(const std::string &nmb,const Factors &coefs= Factors());
54  void clear(void);
55  void copy(const map_actions_and_factors &pond);
56  protected:
57  friend class ActionsAndFactors;
58  public:
59  ActionWeightingMap(void);
62  virtual ~ActionWeightingMap(void);
63  cmb_acc::ActionsAndFactors *create(const std::string &,const Factors &coefs= Factors());
64 
65  ActionWrapper &insert(const std::string &,const std::string &,const Action &,const std::string &combination_factors_name="",const std::string &partial_safety_factors_name="");
66  ActionWrapper &insertGroup(const std::string &, const std::string &, const std::vector<Action> &, const std::vector<std::string> &, const std::string &);
67  ActionWrapper &insertGroupPy(const std::string &, const std::string &, const boost::python::list &, const std::string &);
68 
69  size_t size(void) const;
70  bool empty(void) const;
71  iterator begin(void);
72  const_iterator begin(void) const;
73  iterator end(void);
74  const_iterator end(void) const;
75  boost::python::list getKeys(void) const;
76  ActionsAndFactors *findByName(const std::string &nmb);
77  const ActionsAndFactors *findByName(const std::string &nmb) const;
78 
80  };
81 
82 } // fin namespace cmb_acc
83 
84 #endif
ActionWeightingMap & operator=(const ActionWeightingMap &)
Assignment operator (NO COPIA LAS ACTIONS_AND_FACTORS).
Definition: ActionWeightingMap.cc:76
cmb_acc::ActionsAndFactors * create(const std::string &, const Factors &coefs=Factors())
Define una ponderación de acciones.
Definition: ActionWeightingMap.cc:84
Routines to generate combinations of actions.
Container for all the action families.
Definition: ActionsAndFactors.h:34
ActionWrapper & insertGroup(const std::string &, const std::string &, const std::vector< Action > &, const std::vector< std::string > &, const std::string &)
Insert the group of actions being passed as parameter and sets its combination and partial safety fac...
Definition: ActionWeightingMap.cc:123
size_t size(void) const
Return el número de actions_and_factors de todas las actions_and_factors.
Definition: ActionWeightingMap.cc:184
Almacena todas las familias de acciones.
Definition: Factors.h:34
Container for ActionAndFactors objects.
Definition: ActionWeightingMap.h:42
ActionsAndFactors * findByName(const std::string &nmb)
Return a pointer to the object with argument name.
Definition: ActionWeightingMap.cc:32
LoadCombinations getLoadCombinations(void)
Return the combinations that correspond to all actions_and_factors.
Definition: ActionWeightingMap.cc:210
Action or linear combination of actions.
Definition: Action.h:44
bool empty(void) const
brief Return verdadero si las actions_and_factors estan vacías.
Definition: ActionWeightingMap.cc:188
Almacena todas las Load Combinations que deben formarse para las acciones.
Definition: LoadCombinations.h:35
Objet that can execute python scripts.
Definition: CommandEntity.h:40
ActionWrapper & insert(const std::string &, const std::string &, const Action &, const std::string &combination_factors_name="", const std::string &partial_safety_factors_name="")
Insert the action being passed as parameter.
Definition: ActionWeightingMap.cc:99
boost::python::list getKeys(void) const
Return the names of the action weightings.
Definition: ActionWeightingMap.cc:201
ActionWeightingMap(void)
Default constructor.
Definition: ActionWeightingMap.cc:65
Base class for action design values and action groups.
Definition: ActionWrapper.h:42
ActionWrapper & insertGroupPy(const std::string &, const std::string &, const boost::python::list &, const std::string &)
Insert the group of actions being passed as parameter and sets its combination and partial safety fac...
Definition: ActionWeightingMap.cc:145