xc
ActionWrapperList.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 //ActionWrapperList.hxx
22 //Conjunto de acciones.
23 
24 #ifndef ACTIONWRAPPERLIST_HXX
25 #define ACTIONWRAPPERLIST_HXX
26 
27 #include "utility/kernel/CommandEntity.h"
28 #include <deque>
29 #include <memory> //std::shared_ptr
30 #include "SingleActionWrapper.h"
31 #include "GroupActionWrapper.h"
32 
33 namespace cmb_acc{
34 class Variation;
35 class Variations;
36 class CombinationFactorsMap;
37 class PartialSafetyFactorsMap;
38 class ActionsFamily;
39 
42 class ActionWrapperList: public std::deque<std::shared_ptr<ActionWrapper> >, public CommandEntity
43  {
44  public:
45  typedef std::shared_ptr<ActionWrapper> base_pointer;
46  typedef std::deque<std::shared_ptr<ActionWrapper> > base_container;
47  private:
48  friend class Variation;
49  friend class ActionsFamily;
50 
51  ActionWrapper &push_back(const SingleActionWrapper &a);
52  ActionWrapper &push_back(const GroupActionWrapper &a);
53  public:
54  int getIndex(const ActionWrapper *) const;
55  ActionWrapper &insert(const Action &,const std::string &,const std::string &);
56  ActionWrapper &insertGroup(const std::vector<Action> &, const std::vector<std::string> &, const std::string &);
57  ActionWrapper &insertGroupPy(const boost::python::list &, const std::string &);
58  Action buildCombination(const Variation &v,const LeadingActionInfo &) const;
59  const ActionsFamily *getFamily(void) const;
62  Variations computeVariations(const bool &,const bool &,const int &) const;
63  LoadCombinationVector getCombinations(const bool &,const bool &,const LeadingActionInfo &) const;
64  LoadCombinationVector getCombinationsWhenLeading(const bool &,const bool &,const bool &, const short int &v) const;
65  void Print(std::ostream &os) const;
66  };
67 
68 std::ostream &operator<<(std::ostream &os,const ActionWrapperList &vs);
69 std::tuple<std::vector<Action>, std::vector<std::string> > extract_action_tuples(const boost::python::list &);
70 
71 } //fin namespace nmb_acc.
72 
73 #endif
Variations computeVariations(const bool &, const bool &, const int &) const
Compute the variations that can be formed with the actions of the list.
Definition: ActionWrapperList.cc:165
List of representative values of actions (ActionWrapper objects).
Definition: ActionWrapperList.h:42
ActionWrapper & insertGroup(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: ActionWrapperList.cc:74
Contenedor de coeficientes de simultaneidad de acciones.
Definition: CombinationFactorsMap.h:39
Partial safety factors container.
Definition: PartialSafetyFactorsMap.h:37
const CombinationFactorsMap * getPtrCombinationFactors(void) const
Return a pointer to the table of combination factors.
Definition: ActionWrapperList.cc:133
Routines to generate combinations of actions.
Conjunto de las posibles variations de dos elementos (partial_safety_factors_fav y partial_safety_fac...
Definition: Variations.h:35
std::tuple< std::vector< Action >, std::vector< std::string > > extract_action_tuples(const boost::python::list &)
Extract the (action, combination_factors_name) pairs from the argument list.
Definition: ActionWrapperList.cc:273
Vector that stores the factors of the linear combination of actions.
Definition: Variation.h:36
Wrapper for a single action.
Definition: SingleActionWrapper.h:34
Wrapper for a group action.
Definition: GroupActionWrapper.h:34
Action or linear combination of actions.
Definition: Action.h:44
LoadCombinationVector getCombinations(const bool &, const bool &, const LeadingActionInfo &) const
Return the load combinations for a leading action.
Definition: ActionWrapperList.cc:188
Information about the leading action.
Definition: LeadingActionInfo.h:35
Objet that can execute python scripts.
Definition: CommandEntity.h:40
Action buildCombination(const Variation &v, const LeadingActionInfo &) const
Build the combination of actions defined by the variation argument.
Definition: ActionWrapperList.cc:100
Base class for action design values and action groups.
Definition: ActionWrapper.h:42
ActionWrapper & insert(const Action &, const std::string &, const std::string &)
Insert the action being passed as parameter and sets its combination and partial safety factors...
Definition: ActionWrapperList.cc:58
ActionWrapper & insertGroupPy(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: ActionWrapperList.cc:88
Combination container.
Definition: LoadCombinationVector.h:36
LoadCombinationVector getCombinationsWhenLeading(const bool &, const bool &, const bool &, const short int &v) const
Return the load combinations for a leading action.
Definition: ActionWrapperList.cc:220
Family of actions (permanent, variable, accidental,...)
Definition: ActionsFamily.h:44
int getIndex(const ActionWrapper *) const
Return the index of the argument in the list.
Definition: ActionWrapperList.cc:112
const PartialSafetyFactorsMap * getPtrPartialSafetyFactors(void) const
Return a pointer to the table of coeficientes de simultaneidad.
Definition: ActionWrapperList.cc:147
void Print(std::ostream &os) const
Print stuff.
Definition: ActionWrapperList.cc:257
const ActionsFamily * getFamily(void) const
Return the family that owns this list.
Definition: ActionWrapperList.cc:129