[Mockpp-commits] mockpp/mockpp/production .cvsignore,NONE,1.1 Makefile.am,NONE,1.1 TimeServer.cpp,NO
Brought to you by:
ewald-arnold
From: Ewald A. <ewa...@us...> - 2005-04-30 15:06:15
|
Update of /cvsroot/mockpp/mockpp/mockpp/production In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18839/mockpp/production Added Files: .cvsignore Makefile.am TimeServer.cpp TimeServer.h mockpp_production.h Log Message: time server classes --- NEW FILE: .cvsignore --- *.xmi Makefile .directory Makefile.in *.~* .libs .deps *.lo *.la *.loT *.old --- NEW FILE: Makefile.am --- INCLUDES = $(all_includes) -I$(top_srcdir) lib_LTLIBRARIES = libmockpp_production.la libmockpp_production_la_LDFLAGS = -no-undefined -version-info \ $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) libmockpp_production_la_SOURCES = TimeServer.cpp pkginclude_HEADERS = mockpp_production.h --- NEW FILE: TimeServer.h --- /** @file @brief Time dependent objects $Id: TimeServer.h,v 1.1 2005/04/30 15:06:05 ewald-arnold Exp $ **************************************************************************/ /************************************************************************** begin : Sat Apr 30 2005 copyright : (C) 2002-2005 by Ewald Arnold email : mockpp at ewald-arnold dot de This program 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 2 of the License, or (at your option) any later version. This program 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 Lesser General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. **/ #ifndef MOCKPP_TimeServer_H #define MOCKPP_TimeServer_H #include <mockpp/mockpp.h> // always first #include <ctime> namespace mockpp { /** Base class for time serving purposes * \ingroup grp_production */ class TimeServer { public: /** Destroys the time server. */ virtual ~TimeServer(); /** Returns the current unix time * @return unix time */ virtual std::time_t getUnixTime() = 0; }; /** Real time serving. */ class RealTimeServer : public TimeServer { public: /** Returns the current unix time * @return unix time */ virtual std::time_t getUnixTime(); }; } // namespace mockpp #endif // MOCKPP_TimeServer_H --- NEW FILE: mockpp_production.h --- /** @file @brief Time dependent objects $Id: mockpp_production.h,v 1.1 2005/04/30 15:06:05 ewald-arnold Exp $ **************************************************************************/ /************************************************************************** begin : Dat Apr 30 2005 copyright : (C) 2002-2005 by Ewald Arnold email : mockpp at ewald-arnold dot de This program 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 2 of the License, or (at your option) any later version. This program 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 Lesser General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. **/ #ifndef MOCKPP_PRODUCTION_H #define MOCKPP_PRODUCTION_H #include <mockpp/mockpp.h> // always first /** @defgroup grp_production Support in Production Code * This module contains classes that helps to prepare production code * for testing with mock objects. This code is placed in a library * of it's own. So it is still possible to run production code * without the bloat of the testing environment. */ namespace mockpp { } // namespace mockpp #endif // MOCKPP_PRODUCTION_H --- NEW FILE: TimeServer.cpp --- /** @file @brief Time dependent objects $Id: TimeServer.cpp,v 1.1 2005/04/30 15:06:05 ewald-arnold Exp $ **************************************************************************/ /************************************************************************** begin : Sat Apr 30 2005 copyright : (C) 2002-2005 by Ewald Arnold email : mockpp at ewald-arnold dot de This program 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 2 of the License, or (at your option) any later version. This program 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 Lesser General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. **/ #include <mockpp/mockpp.h> // always first #include <mockpp/production/TimeServer.h> namespace mockpp { MOCKPP_EXPORT TimeServer::~TimeServer() { } /////////////////////////////////////////////////////////////// std::time_t MOCKPP_EXPORT RealTimeServer::getUnixTime() { return std::time(NULL); } } // namespace mockpp |