/*////////////////////////////////////////////////////////////////////////////// // CMT Cosmic Muon Tomography project ////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////// Copyright (c) 2014, Universita' degli Studi di Padova, INFN sez. di Padova All rights reserved Authors: Andrea Rigoni Garola < andrea.rigoni@pd.infn.it > ------------------------------------------------------------------ This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 3.0 of the License, or (at your option) any later version. This library 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library. //////////////////////////////////////////////////////////////////////////////*/ #include #include "testing-prototype.h" #include namespace uLib { //// INTERFACE TO COMPLEX CLASS ///// namespace Interface { struct Test { MAKE_TRAITS template void check_structural() { uLibCheckFunction(Self, test, bool, int, float); uLibCheckMember(Self, testmemb, int); } }; } // namespace Interface struct Test { bool test(int i, float f) { return true; } int testmemb; }; //// INTERFAC TO SIMPLE CLASS /////////// namespace Interface { struct Simple { MAKE_TRAITS template void check_structural() { uLibCheckMember(Self, memb1, int); uLibCheckMember(Self, memb2, float); } }; } // namespace Interface struct Simple { int memb1; float memb2; }; ///////////////////////// template class UseTest { public: UseTest() { Interface::IsA(); T t; int i; float f; t.test(i, f); } }; template class UseSimple { public: UseSimple() { Interface::IsA(); } }; } // namespace uLib int main() { BEGIN_TESTING(Static Interface); uLib::UseTest u; uLib::UseSimple s; END_TESTING; }