iLab Neuromorphic Robotics Toolkit  0.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
test-ManifestParser.C
Go to the documentation of this file.
1 /*! @file
2  @author Randolph Voorhies
3  @copyright GNU Public License (GPL v3)
4  @section License
5  @verbatim
6  // ////////////////////////////////////////////////////////////////////////
7  // The iLab Neuromorphic Robotics Toolkit (NRT) //
8  // Copyright 2010-2012 by the University of Southern California (USC) //
9  // and the iLab at USC. //
10  // //
11  // iLab - University of Southern California //
12  // Hedco Neurociences Building, Room HNB-10 //
13  // Los Angeles, Ca 90089-2520 - USA //
14  // //
15  // See http://ilab.usc.edu for information about this project. //
16  // ////////////////////////////////////////////////////////////////////////
17  // This file is part of The iLab Neuromorphic Robotics Toolkit. //
18  // //
19  // The iLab Neuromorphic Robotics Toolkit is free software: you can //
20  // redistribute it and/or modify it under the terms of the GNU General //
21  // Public License as published by the Free Software Foundation, either //
22  // version 3 of the License, or (at your option) any later version. //
23  // //
24  // The iLab Neuromorphic Robotics Toolkit is distributed in the hope //
25  // that it will be useful, but WITHOUT ANY WARRANTY; without even the //
26  // implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR //
27  // PURPOSE. See the GNU General Public License for more details. //
28  // //
29  // You should have received a copy of the GNU General Public License //
30  // along with The iLab Neuromorphic Robotics Toolkit. If not, see //
31  // <http://www.gnu.org/licenses/>. //
32  // ////////////////////////////////////////////////////////////////////////
33  @endverbatim */
34 
35 
37 
38 int main(int argc, char** argv)
39 {
40  if(argc != 2)
41  { std::cerr << "Usage: " << argv[0] << " filename" << std::endl; exit(-1); }
42 
43  nrt::ModuleManifest m = nrt::readManifest(argv[1]);
44 
45  std::cout << "Display Name: " << m.general.displayname << std::endl << std::endl;
46  std::cout << "Class Name: " << m.general.classname << std::endl << std::endl;
47  std::cout << "Category: "; for(std::string c : m.general.category) std::cout << "/" << c; std::cout << std::endl << std::endl;
48  std::cout << "Synopsis: " << m.general.synopsis << std::endl << std::endl;
49  std::cout << "Description: " << m.general.description << std::endl << std::endl;
50  std::cout << "Keywords: "; for(std::string k : m.general.keywords) std::cout << " " << k; std::cout << std::endl << std::endl;
51 
52  std::cout << "Subscriber Ports: " << std::endl;
53  for(nrt::ModuleManifest::subscriberportdescription s : m.general.subscriberports)
54  {
55  std::cout << " Name: " << s.name << std::endl;
56  std::cout << " InMsg: " << s.inmsg << std::endl;
57  std::cout << " RetMsg: " << s.retmsg << std::endl;
58  std::cout << " Description: " << s.description << std::endl;
59  std::cout << std::endl;
60  }
61  std::cout << std::endl;
62  std::cout << "Checker Ports: " << std::endl;
63  for(nrt::ModuleManifest::checkerportdescription c : m.general.checkerports)
64  {
65  std::cout << " Name: " << c.name << std::endl;
66  std::cout << " Msg: " << c.msg << std::endl;
67  std::cout << " Description: " << c.description << std::endl;
68  std::cout << std::endl;
69  }
70  std::cout << std::endl;
71  std::cout << "Poster Ports: " << std::endl;
72  for(nrt::ModuleManifest::posterportdescription p : m.general.posterports)
73  {
74  std::cout << " Name: " << p.name << std::endl;
75  std::cout << " OutMsg: " << p.outmsg << std::endl;
76  std::cout << " RetMsg: " << p.retmsg << std::endl;
77  std::cout << " Description: " << p.description << std::endl;
78  std::cout << std::endl;
79  }
80 
81 
82  return 0;
83 }
84