NTRT Simulator  v1.1
 All Classes Namespaces Files Functions Variables Typedefs Friends Pages
tgBuildSpec.h
Go to the documentation of this file.
1 /*
2  * Copyright © 2012, United States Government, as represented by the
3  * Administrator of the National Aeronautics and Space Administration.
4  * All rights reserved.
5  *
6  * The NASA Tensegrity Robotics Toolkit (NTRT) v1 platform is licensed
7  * under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  * http://www.apache.org/licenses/LICENSE-2.0.
11  *
12  * Unless required by applicable law or agreed to in writing,
13  * software distributed under the License is distributed on an
14  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
15  * either express or implied. See the License for the specific language
16  * governing permissions and limitations under the License.
17 */
18 
27 #ifndef TG_BUILD_SPEC_H
28 #define TG_BUILD_SPEC_H
29 
30 #include <vector>
31 
32 #include "core/tgTagSearch.h"
33 
34 class tgRigidInfo;
35 class tgConnectorInfo;
36 
42 {
43 public:
44  struct RigidAgent
45  {
46  public:
47  RigidAgent(tgTagSearch s, tgRigidInfo* b) : tagSearch(s), infoFactory(b)
48  {}
49  RigidAgent(std::string s, tgRigidInfo* b) : tagSearch(tgTagSearch(s)), infoFactory(b)
50  {}
51  ~RigidAgent();
52 
53  tgTagSearch tagSearch;
54 
55  // We own this (@todo: do we?)
56  tgRigidInfo* infoFactory;
57  };
58 
60  {
61  public:
62  ConnectorAgent(tgTagSearch s, tgConnectorInfo* b) : tagSearch(s), infoFactory(b)
63  {}
64  ConnectorAgent(std::string s, tgConnectorInfo* b) : tagSearch(tgTagSearch(s)), infoFactory(b)
65  {}
66  ~ConnectorAgent();
67 
68  tgTagSearch tagSearch;
69 
70  // We own this (@todo: do we?)
71  tgConnectorInfo* infoFactory;
72  };
73 
74  tgBuildSpec() {}
75  virtual ~tgBuildSpec();
76 
77  void addBuilder(std::string tag_search, tgRigidInfo* infoFactory);
78 
79  void addBuilder(std::string tag_search, tgConnectorInfo* infoFactory);
80 
81  std::vector<RigidAgent*> getRigidAgents()
82  {
83  return m_rigidAgents;
84  }
85 
86  std::vector<ConnectorAgent*> getConnectorAgents()
87  {
88  return m_connectorAgents;
89  }
90 
91 private:
92  std::vector<RigidAgent*> m_rigidAgents;
93  std::vector<ConnectorAgent*> m_connectorAgents;
94 };
95 
96 #endif
Contains the definition of class tgTagSearch.