/** @file EventVarLength.h @author Brian Magill @datecreated 2/22/2008 $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 Returns the length of an EventVar object stored in an Event object */ //---------------------------------------------------------------------- // #include //#include #include #include "EventVar.h" #include "EventVarLength.h" //#include "GATS_Utilities.hpp" using namespace std; //using namespace gatsDBpp; long EventVarLength::operator () (std::string varName) const { string strErr; long arraySize; switch (inEvent->EventVarExists(varName) ) { case NOVAR: strErr = string("No entry for ") + varName + string(" in ouput Event object"); throw runtime_error(strErr); break; case INTEGER: { EventVar varArray; inEvent->getEventVar(varName, varArray); arraySize = varArray.size(); break; } case FLOAT: { EventVar varArray; inEvent->getEventVar(varName, varArray); arraySize = varArray.size(); break; } case DOUBLE: { EventVar varArray; inEvent->getEventVar(varName, varArray); arraySize = varArray.size(); break; } default: throw runtime_error("programming error in Event::EventVarExists(). Bad Type!"); } return arraySize; }