NTRT Simulator
 All Classes 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 
26 #ifndef TG_BUILD_SPEC_H
27 #define TG_BUILD_SPEC_H
28 
29 #include <vector>
30 
31 #include "core/tgTagSearch.h"
32 
33 class tgRigidInfo;
34 class tgConnectorInfo;
35 
41 {
42 public:
43  struct RigidAgent
44  {
45  public:
46  RigidAgent(tgTagSearch s, tgRigidInfo* b) : tagSearch(s), infoFactory(b)
47  {}
48  RigidAgent(std::string s, tgRigidInfo* b) : tagSearch(tgTagSearch(s)), infoFactory(b)
49  {}
50  ~RigidAgent();
51 
52  tgTagSearch tagSearch;
53 
54  // We own this (@todo: do we?)
55  tgRigidInfo* infoFactory;
56  };
57 
59  {
60  public:
61  ConnectorAgent(tgTagSearch s, tgConnectorInfo* b) : tagSearch(s), infoFactory(b)
62  {}
63  ConnectorAgent(std::string s, tgConnectorInfo* b) : tagSearch(tgTagSearch(s)), infoFactory(b)
64  {}
65  ~ConnectorAgent();
66 
67  tgTagSearch tagSearch;
68 
69  // We own this (@todo: do we?)
70  tgConnectorInfo* infoFactory;
71  };
72 
73  tgBuildSpec() {}
74  virtual ~tgBuildSpec();
75 
76  void addBuilder(std::string tag_search, tgRigidInfo* infoFactory);
77 
78  void addBuilder(std::string tag_search, tgConnectorInfo* infoFactory);
79 
80  std::vector<RigidAgent*> getRigidAgents()
81  {
82  return m_rigidAgents;
83  }
84 
85  std::vector<ConnectorAgent*> getConnectorAgents()
86  {
87  return m_connectorAgents;
88  }
89 
90 private:
91  std::vector<RigidAgent*> m_rigidAgents;
92  std::vector<ConnectorAgent*> m_connectorAgents;
93 };
94 
95 #endif
Contains the definition of class tgTagSearch $Id$.