iLab Neuromorphic Robotics Toolkit  0.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
tests/test-ManifestParser.C
/*! @file
@author Randolph Voorhies
@copyright GNU Public License (GPL v3)
@section License
@verbatim
// ////////////////////////////////////////////////////////////////////////
// The iLab Neuromorphic Robotics Toolkit (NRT) //
// Copyright 2010-2012 by the University of Southern California (USC) //
// and the iLab at USC. //
// //
// iLab - University of Southern California //
// Hedco Neurociences Building, Room HNB-10 //
// Los Angeles, Ca 90089-2520 - USA //
// //
// See http://ilab.usc.edu for information about this project. //
// ////////////////////////////////////////////////////////////////////////
// This file is part of The iLab Neuromorphic Robotics Toolkit. //
// //
// The iLab Neuromorphic Robotics Toolkit is free software: you can //
// redistribute it and/or modify it under the terms of the GNU General //
// Public License as published by the Free Software Foundation, either //
// version 3 of the License, or (at your option) any later version. //
// //
// The iLab Neuromorphic Robotics Toolkit is distributed in the hope //
// that it will be useful, but WITHOUT ANY WARRANTY; without even the //
// implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR //
// PURPOSE. See the GNU General Public License for more details. //
// //
// You should have received a copy of the GNU General Public License //
// along with The iLab Neuromorphic Robotics Toolkit. If not, see //
// <http://www.gnu.org/licenses/>. //
// ////////////////////////////////////////////////////////////////////////
@endverbatim */
int main(int argc, char** argv)
{
if(argc != 2)
{ std::cerr << "Usage: " << argv[0] << " filename" << std::endl; exit(-1); }
nrt::ModuleManifest m = nrt::readManifest(argv[1]);
std::cout << "Display Name: " << m.general.displayname << std::endl << std::endl;
std::cout << "Class Name: " << m.general.classname << std::endl << std::endl;
std::cout << "Category: "; for(std::string c : m.general.category) std::cout << "/" << c; std::cout << std::endl << std::endl;
std::cout << "Synopsis: " << m.general.synopsis << std::endl << std::endl;
std::cout << "Description: " << m.general.description << std::endl << std::endl;
std::cout << "Keywords: "; for(std::string k : m.general.keywords) std::cout << " " << k; std::cout << std::endl << std::endl;
std::cout << "Subscriber Ports: " << std::endl;
for(nrt::ModuleManifest::subscriberportdescription s : m.general.subscriberports)
{
std::cout << " Name: " << s.name << std::endl;
std::cout << " InMsg: " << s.inmsg << std::endl;
std::cout << " RetMsg: " << s.retmsg << std::endl;
std::cout << " Description: " << s.description << std::endl;
std::cout << std::endl;
}
std::cout << std::endl;
std::cout << "Checker Ports: " << std::endl;
for(nrt::ModuleManifest::checkerportdescription c : m.general.checkerports)
{
std::cout << " Name: " << c.name << std::endl;
std::cout << " Msg: " << c.msg << std::endl;
std::cout << " Description: " << c.description << std::endl;
std::cout << std::endl;
}
std::cout << std::endl;
std::cout << "Poster Ports: " << std::endl;
for(nrt::ModuleManifest::posterportdescription p : m.general.posterports)
{
std::cout << " Name: " << p.name << std::endl;
std::cout << " OutMsg: " << p.outmsg << std::endl;
std::cout << " RetMsg: " << p.retmsg << std::endl;
std::cout << " Description: " << p.description << std::endl;
std::cout << std::endl;
}
return 0;
}