/** @file MetaTableList.cpp @author Brian Magill @datecreated 3/07/2007 $Date:$ $Revision:$ @copyright (©) Copyright 2006 by GATS Inc. 11864 Canon Blvd., Suite 101, Newport News, VA 23606 All Rights Reserved. No part of this software or publication may be reproduced, stored in a retrieval system, or transmitted, in any form or by any means, electronic, mechanical, photocopying, recording, or otherwise without the prior written permission of GATS Inc. @brief given a table with metadata including table names, returns a list of tables */ //---------------------------------------------------------------------- // #include #include //#include "Event.h" #include "GATS_DB.h" #include "GATS_DB_Exception.h" #include "GATS_Utilities.hpp" #include "MetaTableList.h" using namespace std; using namespace gatsDBpp; vector MetaTableList::getChosen( ) const { vector list; unsigned long i; try { GATS_DB_Results results; string strQuery = "SELECT TableName FROM " + metaTable + " WHERE WriteFlag = 'Y'"; // cout << strQuery << endl; results = dbConn->Query(strQuery.c_str()); for( i = 0; i < results.size(); i++) list.push_back(results[i][0].asString()); } catch (exception &ex) { string errstr = string("MetaTableList::getChosen( ) Error: ") + ex.what(); throw runtime_error(errstr); } return list; } vector MetaTableList::getAll( ) const { vector list; unsigned long i; try { GATS_DB_Results results; string strQuery = "SELECT TableName FROM " + metaTable; // cout << strQuery << endl; results = dbConn->Query(strQuery.c_str()); for( i = 0; i < results.size(); i++) list.push_back(results[i][0].asString()); } catch (exception &ex) { string errstr = string("MetaTableList::getAll( ) Error: ") + ex.what(); throw runtime_error(errstr); } return list; }