#ifndef __VALARRAY_CONVERSIONS_2006_05_19__ #define __VALARRAY_CONVERSIONS_2006_05_19__ /** @file ValarrayConv.hpp @author Brian Magill @creationdate 5/19/2006 @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 Converts between valarrays vectors and EventVarVect Based upon nontemplated version by Martin McHugh */ #include #include #include "EventVarVect.h" #include "StrTools.h" template void ConvToEventVect(std::vector > const & valVec, EventVarVect &eventVec) { EventVar EventData; for(unsigned long i = 0; i < valVec.size(); i++) { EventData = EventVar ( "", valVec[i] ); EventData.setName( toString(i + 1) ); eventVec.addEventVar(EventData); } }; template void ConvToValarrayVec(EventVarVect const & eventVec, std::vector > &valVec ) { std::valarray valVar; valVec.clear(); for(unsigned long i = 0; i < eventVec.size(); i++) { valVar.resize(eventVec[i].size() ); valVar = eventVec[i]; valVec.push_back(valVar); } } #endif