yake-svn Mailing List for Yake Engine (Page 3)
Status: Beta
Brought to you by:
psyclonist
You can subscribe to this list here.
| 2006 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(17) |
Sep
(51) |
Oct
(2) |
Nov
(18) |
Dec
(66) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2007 |
Jan
(44) |
Feb
(13) |
Mar
(73) |
Apr
(61) |
May
|
Jun
(4) |
Jul
(19) |
Aug
(50) |
Sep
(47) |
Oct
(7) |
Nov
(7) |
Dec
(14) |
| 2008 |
Jan
(2) |
Feb
|
Mar
(4) |
Apr
(4) |
May
(5) |
Jun
(7) |
Jul
(4) |
Aug
|
Sep
(5) |
Oct
|
Nov
(1) |
Dec
(4) |
| 2009 |
Jan
|
Feb
(22) |
Mar
(12) |
Apr
(1) |
May
(1) |
Jun
(4) |
Jul
(4) |
Aug
|
Sep
|
Oct
(17) |
Nov
(3) |
Dec
|
| 2010 |
Jan
|
Feb
|
Mar
(12) |
Apr
(11) |
May
|
Jun
(5) |
Jul
(3) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: <psy...@us...> - 2009-10-08 22:09:45
|
Revision: 1987
http://yake.svn.sourceforge.net/yake/?rev=1987&view=rev
Author: psyclonist
Date: 2009-10-08 22:09:38 +0000 (Thu, 08 Oct 2009)
Log Message:
-----------
avoid compiler warning due to cast
Modified Paths:
--------------
branches/yake2/yake/src/base/math/yakeRay.cpp
Modified: branches/yake2/yake/src/base/math/yakeRay.cpp
===================================================================
--- branches/yake2/yake/src/base/math/yakeRay.cpp 2009-07-12 20:49:16 UTC (rev 1986)
+++ branches/yake2/yake/src/base/math/yakeRay.cpp 2009-10-08 22:09:38 UTC (rev 1987)
@@ -35,7 +35,7 @@
{
const real denom = plane.normal.dotProduct(ray.direction());
if (Math::Abs(denom) < std::numeric_limits<real>::epsilon())
- return std::make_pair(false,0);
+ return std::make_pair(false,0.);
const real nom = plane.normal.dotProduct(ray.origin().asVector()) + plane.d;
const real t = - (nom / denom);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <psy...@us...> - 2009-07-12 20:49:21
|
Revision: 1986
http://yake.svn.sourceforge.net/yake/?rev=1986&view=rev
Author: psyclonist
Date: 2009-07-12 20:49:16 +0000 (Sun, 12 Jul 2009)
Log Message:
-----------
Removed yake::Configuration and thereby dependency on boost::property_tree which is not part of the boost distribution (yet?).
Modified Paths:
--------------
branches/yake2/yake/src/base/yakeConfigFile.cpp
branches/yake2/yake/yake/base/yakeConfigFile.h
Modified: branches/yake2/yake/src/base/yakeConfigFile.cpp
===================================================================
--- branches/yake2/yake/src/base/yakeConfigFile.cpp 2009-07-09 14:46:20 UTC (rev 1985)
+++ branches/yake2/yake/src/base/yakeConfigFile.cpp 2009-07-12 20:49:16 UTC (rev 1986)
@@ -28,127 +28,10 @@
#include <yake/base/yakePCH.h>
#include <yake/base/yakeConfigFile.h>
#include <yake/base/templates/yakeSmartAssert.h>
+#include <fstream>
namespace yake {
- namespace detail {
- } // namespace detail
-
- Configuration::Configuration() : tree_( new tree_type() )
- {
- }
- Configuration::Configuration(const Configuration& other) : tree_(other.tree_), prefix_(other.prefix_)
- {
- }
- const Configuration& Configuration::operator=(const Configuration& rhs)
- {
- if (this == &rhs)
- return *this;
- tree_ = rhs.tree_;
- prefix_ = rhs.prefix_;
- return *this;
- }
- Configuration::Configuration(const Configuration& cfg, const String& path) : tree_( cfg.tree_ ), prefix_(path)
- {
- if (!prefix_.empty())
- {
- // make sure there's a trailing '/'
- if (prefix_.at( prefix_.size() -1 ) != '/')
- prefix_ += '/';
- }
- }
- void Configuration::copyFrom(const Configuration& other)
- {
- tree_.reset( new tree_type() );
- if (other.tree_)
- *tree_ = *other.tree_;
- prefix_ = other.prefix_;
- }
- Configuration::~Configuration()
- {
- }
- Configuration::const_iterator Configuration::begin(const String& path) const
- {
- try {
- return tree_->get_child('/',prefix_+path).begin();
- }
- catch (boost::property_tree::ptree_error&)
- {
- return tree_->end();
- }
- }
- Configuration::const_iterator Configuration::end(const String& path) const
- {
- try {
- return tree_->get_child('/',prefix_+path).end();
- }
- catch (boost::property_tree::ptree_error&)
- {
- return tree_->end();
- }
- }
- bool Configuration::exists(const String& path) const
- {
- try {
- tree_->get_child('/',prefix_+path);
- return true;
- }
- catch (boost::property_tree::ptree_error&)
- {
- return false;
- }
- }
- String Configuration::get(const String& pathToValue, const String& defaultValue) const
- {
- try {
- return tree_->get<String>('/',prefix_+pathToValue);
- }
- catch (...)
- {
- return defaultValue;
- }
- }
- void Configuration::readFromFile(const String& fn, const String& insertAt)
- {
- YAKE_ASSERT( insertAt.empty() ).debug("not yet supported" );
- std::ifstream in(fn.c_str());
- if (!in.is_open())
- return; //@todo
- boost::property_tree::read_info(in,*tree_);
- }
-#if 0
- void Configuration::readFromXML(const String& fn, const String& insertAt)
- {
- YAKE_ASSERT( insertAt.empty() ).debug("not yet supported" );
- std::ifstream in(fn.c_str());
- if (!in.is_open())
- return; //@todo
- boost::property_tree::read_xml(in,*tree_);
- }
-#endif
- void Configuration::writeToFile(const String& fn, const String& startAt)
- {
- YAKE_ASSERT( startAt.empty() ).debug("not yet supported" );
- //boost::property_tree::write_info(cout,*tree_);
-
- std::ofstream out(fn.c_str());
- if (!out.is_open())
- return; //@todo
- boost::property_tree::write_info(out,*tree_);
- }
-#if 0
- void Configuration::writeToXML(const String& fn, const String& startAt)
- {
- YAKE_ASSERT( startAt.empty() && "not yet supported" );
- //boost::property_tree::write_xml(cout,*tree_);
-
- std::ofstream out(fn.c_str());
- if (!out.is_open())
- return; //@todo
- boost::property_tree::write_xml(out,*tree_);
- }
-#endif
-
//-----------------------------------------------------
IniFile::IniFile()
Modified: branches/yake2/yake/yake/base/yakeConfigFile.h
===================================================================
--- branches/yake2/yake/yake/base/yakeConfigFile.h 2009-07-09 14:46:20 UTC (rev 1985)
+++ branches/yake2/yake/yake/base/yakeConfigFile.h 2009-07-12 20:49:16 UTC (rev 1986)
@@ -33,123 +33,12 @@
#endif
#include <yake/base/templates/yakePointer.h>
#include <yake/base/yakeNoncopyable.h>
+#include <map>
+#include <boost/optional.hpp>
-// for Configuration
-#if YAKE_COMPILER == COMPILER_MSVC
-#pragma warning(push)
-#pragma warning(disable: 4267) // '=' : conversion from 'size_t' to 'unsigned int' ...
-#endif
-//#define BOOST_PROPERTY_TREE_XML_PARSER_TINYXML
-//#if defined(TIXML_USE_STL) // property_tree/xml_parser_read_tinyxml.hpp will redefine this.
-//#undef TIXML_USE_STL
-//#endif
-#include <boost/property_tree/ptree.hpp>
-//#include <boost/property_tree/xml_parser.hpp>
-#include <boost/property_tree/info_parser.hpp>
-#if YAKE_COMPILER == COMPILER_MSVC
-#pragma warning(pop)
-#endif
-
-// Undef min and max macros on Windows. They're defined in windef.h.
-// And unfortunately, the property_tree includes pull them in.
-#if (YAKE_PLATFORM == PLATFORM_WIN32)
- #ifdef min
- #undef min
- #endif
- #ifdef max
- #undef max
- #endif
-#endif
-
namespace yake {
- struct YAKE_BASE_API Configuration
- {
- // types
- typedef boost::property_tree::ptree tree_type;
- typedef SharedPtr<tree_type> tree_ptr;
- typedef tree_type::const_iterator const_iterator;
- typedef tree_type::value_type value_type;
- /** Construct empty configuration object. */
- Configuration();
- /** Copy-construct configuration object.
- @note Both Configurations share the data!
- */
- Configuration(const Configuration& other);
- /** Copy configuration data.
- @note Both Configurations share the data!
- */
- const Configuration& operator=(const Configuration& rhs);
- /** Copy-construct configuration but with optional offset into the hierarchy (i.e. path != "").
- */
- Configuration(const Configuration& cfg, const String& path);
- void copyFrom(const Configuration& other);
- ~Configuration();
-
- /** Returns iterator to the first of any children.
- */
- const_iterator begin(const String& path = "") const;
- /** Returns iterator to one element beyond the last of any children.
- */
- const_iterator end(const String& path = "") const;
- bool exists(const String& path) const;
-
- /** Returns the value for the given path.
- @note Throws if node does not exist!
- */
- template<typename T>
- T get(const String& pathToValue)
- {
- tree_->get<T>('/',prefix_+pathToValue);
- }
- /** Returns either value for the given path, or the default value if the path does not exist
- or if the type conversion failed.
- */
- String get(const String& pathToValue, const String& defaultValue) const;
- /** Returns either value for the given path, or the default value if the path does not exist
- or if the type conversion failed.
- @note Type conversion is done automatically.
- */
- template<typename T>
- T get(const String& pathToValue, const T& defaultValue) const
- {
- try {
- return tree_->get<T>('/',prefix_+pathToValue);
- }
- catch (...)
- {
- return defaultValue;
- }
- }
-
- /** Sets the value at the given path.
- Creates entry at the path if necessary.
- */
- template<typename T>
- void set(const String& pathToValue, const T& newValue)
- {
- tree_->put('/',prefix_+pathToValue,newValue);
- }
-
- /** Overwrites existing configuration values if conflicts appear!
- */
- void readFromFile(const String& fn, const String& insertAt = "");
- /** Overwrites existing configuration values if conflicts appear!
- */
- /**
- @note Ignores any set offset/prefix!
- */
- void writeToFile(const String& fn, const String& startAt = "");
- /**
- @note Ignores any set offset/prefix!
- */
-
- private:
- tree_ptr tree_;
- String prefix_;
- };
-
/** NB Multiple keys in a single section allowed! */
struct YAKE_BASE_API IniFile : public noncopyable
{
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <psy...@us...> - 2009-07-09 14:46:23
|
Revision: 1985
http://yake.svn.sourceforge.net/yake/?rev=1985&view=rev
Author: psyclonist
Date: 2009-07-09 14:46:20 +0000 (Thu, 09 Jul 2009)
Log Message:
-----------
pulled 'log' out of 'base' library
Modified Paths:
--------------
branches/yake2/yake/premake4.lua
branches/yake2/yake/samples/log1/demo.cpp
branches/yake2/yake/src/base/native/Linux/yakeDebug.cpp
branches/yake2/yake/src/base/native/win32/yakeDebug.cpp
branches/yake2/yake/yake/base/native/yakeNative.h
branches/yake2/yake/yake/base/yake.h
Added Paths:
-----------
branches/yake2/yake/src/log/log.cpp
branches/yake2/yake/src/log/log_file.cpp
branches/yake2/yake/src/log/log_stderr.cpp
branches/yake2/yake/yake/base/yakeStringMap.h
branches/yake2/yake/yake/log/detail/
branches/yake2/yake/yake/log/detail/native.h
branches/yake2/yake/yake/log/log.h
branches/yake2/yake/yake/log/log_file.h
branches/yake2/yake/yake/log/log_stderr.h
Removed Paths:
-------------
branches/yake2/yake/src/base/yakeFileLog.cpp
branches/yake2/yake/src/base/yakeLog.cpp
branches/yake2/yake/src/base/yakeStderrLog.cpp
branches/yake2/yake/yake/base/yakeFileLog.h
branches/yake2/yake/yake/base/yakeLog.h
branches/yake2/yake/yake/base/yakeStderrLog.h
Modified: branches/yake2/yake/premake4.lua
===================================================================
--- branches/yake2/yake/premake4.lua 2009-07-09 14:16:42 UTC (rev 1984)
+++ branches/yake2/yake/premake4.lua 2009-07-09 14:46:20 UTC (rev 1985)
@@ -298,12 +298,12 @@
end
local function project_lib(name,opt)
opt = opt or {}
- project_lib_basic(name,opt)
- files {
+ opt.files = opt.files or {
ROOT_DIR .. "src/"..name.."/**.cpp",
ROOT_DIR .. "yake/"..name.."/**.h",
ROOT_DIR .. "yake/"..name.."/**.inl"
}
+ project_lib_basic(name,opt)
end
local function requires_lib( name )
includedirs { ROOT_DIR .. "yake/" .. name .. "/**" }
@@ -346,15 +346,16 @@
ROOT_DIR .. "src/base/native/linux/*.h"
}
---project_lib "audio"
-project_lib("audio", {require_package = {"boost","lua"}})
- --links { "base" }
+--project_lib("audio", {require_package = {"boost","lua"}})
+-- requires_lib "base"
+project_lib("log", {require_package = {"boost"}})
requires_lib "base"
for k,v in pairs(_OPTIONS) do print("OPT",k,v) end
if not _OPTIONS["without-demos"] then
project_exe "log1"
requires_lib "base"
+ requires_lib "log"
end
--[[
project "demo1"
Modified: branches/yake2/yake/samples/log1/demo.cpp
===================================================================
--- branches/yake2/yake/samples/log1/demo.cpp 2009-07-09 14:16:42 UTC (rev 1984)
+++ branches/yake2/yake/samples/log1/demo.cpp 2009-07-09 14:46:20 UTC (rev 1985)
@@ -1,4 +1,6 @@
-#include "yake/base/yake.h"
+#include <iostream>
+#include "yake/log/log.h"
+#include "yake/log/log_file.h"
using namespace yake;
@@ -6,13 +8,16 @@
{
try
{
- typedef SharedPtr<logging::log_listener> log_listener_ptr;
-
// create and attach log listeners
- log_listener_ptr toStdErr( new yake::logging::stderr_listener() );
- yake::logging::addListener( toStdErr.get() );
- log_listener_ptr toFile( new yake::logging::file_listener("sampleLog.log") );
+ // stderr output:
+ yake::logging::logToStdErr();
+
+ // file output:
+ yake::logging::logToFile( "log1.log" );
+
+ // file output, but using direct creation instead of helper logToFile():
+ SharedPtr<logging::log_listener> toFile( new yake::logging::file_listener("log1_direct.log") );
yake::logging::addListener( toFile.get() );
// log something:
Modified: branches/yake2/yake/src/base/native/Linux/yakeDebug.cpp
===================================================================
--- branches/yake2/yake/src/base/native/Linux/yakeDebug.cpp 2009-07-09 14:16:42 UTC (rev 1984)
+++ branches/yake2/yake/src/base/native/Linux/yakeDebug.cpp 2009-07-09 14:46:20 UTC (rev 1985)
@@ -42,29 +42,6 @@
namespace yake {
namespace native {
-bool debug_Log_available()
-{
- return true;
-}
-
-void debug_Log( const std::string& what, logging::severity_t sev )
-{
- if (sev <= logging::S_ERROR)
- std::cout << "<error >";
- else if (sev <= logging::S_WARNING)
- std::cout << "<warning>";
- else if (sev < logging::S_LAST)
- std::cout << "<info >";
- else
- std::cout << "<custom >";
- std::cout << what << "\n";
-}
-
-void debug_Print( const char* string )
-{
- std::cout << string << "\n";
-}
-
bool debug_AssertFailed( const char* pszMessage,
const char* pszCondition,
const char* pszFile,
Modified: branches/yake2/yake/src/base/native/win32/yakeDebug.cpp
===================================================================
--- branches/yake2/yake/src/base/native/win32/yakeDebug.cpp 2009-07-09 14:16:42 UTC (rev 1984)
+++ branches/yake2/yake/src/base/native/win32/yakeDebug.cpp 2009-07-09 14:46:20 UTC (rev 1985)
@@ -125,74 +125,5 @@
return ( nResult & RESULT_CONTINUE ) == RESULT_CONTINUE;
}
-
-namespace LogConsole
-{
- void Print( const char * text, WORD wAttributes )
- {
- //AllocConsole(); // this would actually open a console window...
-
- HANDLE outHandle = GetStdHandle( STD_ERROR_HANDLE );
- if (!outHandle)
- return;
-
- CONSOLE_SCREEN_BUFFER_INFO csbiInfo;
- ::GetConsoleScreenBufferInfo( outHandle, &csbiInfo );
-
- SetConsoleTextAttribute( outHandle, wAttributes );
- DWORD dwWritten;
- int length = (int)strlen( text );
- ::BOOL bSuccess = WriteConsoleA( outHandle, text, ( DWORD )length, &dwWritten, 0 );
- assert( bSuccess );
-
- // restore settings
- ::SetConsoleTextAttribute( outHandle, csbiInfo.wAttributes );
- }
-}
-
-bool debug_Log_available()
-{
- return (GetStdHandle( STD_ERROR_HANDLE ) != 0);
-}
-
-void debug_Log( const std::string& what, logging::severity_t sev )
-{
- if (what.empty())
- return;
- //AllocConsole(); // this would actually open a console window...
-
- // save settings
- HANDLE outHandle = GetStdHandle( STD_ERROR_HANDLE );
- if (!outHandle)
- return;
- CONSOLE_SCREEN_BUFFER_INFO csbiInfo;
- ::GetConsoleScreenBufferInfo( outHandle, &csbiInfo );
-
- // print
- WORD wAttributes = FOREGROUND_INTENSITY;
- if (sev <= logging::S_ERROR)
- wAttributes |= FOREGROUND_RED; // red
- else if (sev <= logging::S_WARNING)
- wAttributes |= FOREGROUND_GREEN | FOREGROUND_RED; // yellow
- else if (sev < logging::S_LAST)
- wAttributes |= FOREGROUND_GREEN; // green
- else
- wAttributes |= FOREGROUND_GREEN | FOREGROUND_RED; // yellow
- ::SetConsoleTextAttribute( outHandle, wAttributes );
- DWORD dwWritten = 0;
-
- ::BOOL bSuccess = WriteConsoleA( outHandle, what.c_str(), ( DWORD )what.length(), &dwWritten, 0 );
- assert( bSuccess );
-
- // restore settings
- ::SetConsoleTextAttribute( outHandle, csbiInfo.wAttributes );
-}
-
-void debug_Print( const char * string )
-{
- LogConsole::Print( string, FOREGROUND_GREEN | FOREGROUND_BLUE | FOREGROUND_RED );
-}
-
-
} // native
} // yake
Deleted: branches/yake2/yake/src/base/yakeFileLog.cpp
===================================================================
--- branches/yake2/yake/src/base/yakeFileLog.cpp 2009-07-09 14:16:42 UTC (rev 1984)
+++ branches/yake2/yake/src/base/yakeFileLog.cpp 2009-07-09 14:46:20 UTC (rev 1985)
@@ -1,59 +0,0 @@
-/*
- ------------------------------------------------------------------------------------
- This file is part of YAKE
- Copyright (c) 2004 - 2008 The YAKE Team
- For the latest information visit http://www.yake.org
- ------------------------------------------------------------------------------------
- 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 Lesser 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., 59 Temple
- Place - Suite 330, Boston, MA 02111-1307, USA, or go to
- http://www.gnu.org/copyleft/lesser.txt.
- ------------------------------------------------------------------------------------
- If you are interested in another license model contact the Yake Team via
- E-Mail: te...@ya....
- For more information see the LICENSE file in the root directory of the
- source code distribution.
- ------------------------------------------------------------------------------------
-*/
-#include <yake/base/yakePCH.h>
-#include <yake/base/yakeLog.h>
-#include <yake/base/yakeFileLog.h>
-#include <boost/lexical_cast.hpp>
-
-namespace yake {
-namespace logging {
-
- file_listener::file_listener(const std::string& fileName)
- {
- fp_.open(fileName.c_str());
- fp_ << "// format:\n";
- fp_ << "// [processId][logId][threadId] [logLevel] message\n";
- fp_.flush();
- }
- file_listener::~file_listener()
- {
- fp_.close();
- }
- void file_listener::write(const severity_t sev, const char* msg, const char* logId, const char* procId, threadid_t threadId)
- {
- formatLogMessage(fp_, sev, msg, logId, procId, threadId );
- fp_.flush();
- }
- log_listener_ptr file_listener::add(const std::string& fileName)
- {
- log_listener_ptr l( new file_listener(fileName) );
- addListener( l.get() );
- return l;
- }
-
-} // logging
-} // yake
Deleted: branches/yake2/yake/src/base/yakeLog.cpp
===================================================================
--- branches/yake2/yake/src/base/yakeLog.cpp 2009-07-09 14:16:42 UTC (rev 1984)
+++ branches/yake2/yake/src/base/yakeLog.cpp 2009-07-09 14:46:20 UTC (rev 1985)
@@ -1,181 +0,0 @@
-/*
- ------------------------------------------------------------------------------------
- This file is part of YAKE
- Copyright (c) 2004 - 2008 The YAKE Team
- For the latest information visit http://www.yake.org
- ------------------------------------------------------------------------------------
- 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 Lesser 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., 59 Temple
- Place - Suite 330, Boston, MA 02111-1307, USA, or go to
- http://www.gnu.org/copyleft/lesser.txt.
- ------------------------------------------------------------------------------------
- If you are interested in another license model contact the Yake Team via
- E-Mail: te...@ya....
- For more information see the LICENSE file in the root directory of the
- source code distribution.
- ------------------------------------------------------------------------------------
-*/
-#include <yake/base/yakePCH.h>
-#include <yake/base/yakeLog.h>
-#include <yake/base/native/yakeNative.h>
-#include <boost/lexical_cast.hpp>
-#include <map>
-#include <boost/thread/recursive_mutex.hpp>
-#include <boost/thread/locks.hpp>
-
-namespace yake {
-namespace logging {
- namespace detail {
- struct logger_impl
- {
- String procId_;
- typedef std::vector<log_listener*> ListenerList;
- ListenerList targets_;
- typedef std::map<severity_t,bool> EnableMap;
- EnableMap enabledSeverities_;
- typedef std::map<std::string,bool> EnableLogIdMap;
- EnableLogIdMap enabledLogs_;
- boost::recursive_mutex mtx_;
- struct scoped_lock;
- friend struct scoped_lock;
- struct scoped_lock : public boost::noncopyable
- {
- scoped_lock();
- private:
- boost::recursive_mutex::scoped_lock lck_;
- };
- };
- logger_impl::scoped_lock::scoped_lock() : lck_(logger::instance().impl_->mtx_)
- {
- }
- } // detail
-
- log_listener::~log_listener()
- {
- removeListener(this);
- }
-
- void formatLogMessage(std::ostream& out, const severity_t sev, const char* msg, const char* logId, const char* procId, threadid_t threadId)
- {
- out << "[" << (procId ? procId : "") << "]";
-
- out << "[" << (logId ? logId : "") << "]";
-
- out << "[";
- out << std::hex << threadId;
- out << "] ";
-
- out << "[";
- out << toString(Severity(sev));
- if (sev >= S_LAST)
- {
- out << "(";
- out << boost::lexical_cast<std::string>(sev);
- out << ")";
- }
- out << "]";
-
- out << " " << msg << "\n";
- }
-
- const char* toString(const Severity sev)
- {
- static char* severity_names[S_LAST+1] =
- {
- "emergency",
- "alert",
- "critical",
- "error",
- "warning",
- "notice",
- "information",
- "debug",
- "custom"
- };
- return (sev <= S_DEBUG) ? severity_names[sev] : severity_names[S_LAST];
- }
- logger logger::instance_;
- logger& logger::instance()
- {
- return instance_;
- }
- void logger::enableSeverity(const severity_t sev, const bool on)
- {
- detail::logger_impl::scoped_lock lock;
- this->impl_->enabledSeverities_[ sev ] = on;
- }
- void logger::enableLog(const char* logId, const bool on)
- {
- detail::logger_impl::scoped_lock lock;
- instance().impl_->enabledLogs_[ std::string(logId ? logId : "") ] = on;
- }
- void logger::addListener(log_listener* l)
- {
- if (!l)
- return;
- detail::logger_impl::scoped_lock lock;
- instance().impl_->targets_.push_back( l );
- }
- void logger::removeListener(log_listener* l)
- {
- if (!l)
- return;
- detail::logger_impl::scoped_lock lock;
- if (instance().impl_->targets_.empty())
- return;
- instance().impl_->targets_.erase( std::find(instance().impl_->targets_.begin(), instance().impl_->targets_.end(), l) );
- }
- void logger::log(const severity_t sev, const char *logId, const char *msg)
- {
- instance().doLog(sev, logId, msg);
- }
- void logger::doLog(const severity_t sev, const char *logId, const char *msg)
- {
- detail::logger_impl::scoped_lock lock;
-
- detail::logger_impl::EnableMap::const_iterator itEnabled = instance_.impl_->enabledSeverities_.find( sev );
- if (itEnabled != instance_.impl_->enabledSeverities_.end() && !itEnabled->second)
- return;
-
- detail::logger_impl::EnableLogIdMap::const_iterator itLogEnabled = instance_.impl_->enabledLogs_.find( logId );
- if (itLogEnabled != instance_.impl_->enabledLogs_.end() && !itLogEnabled->second)
- return;
-
- const threadid_t threadId = native::getCurrentThreadId();
- detail::logger_impl::ListenerList::const_iterator itEnd = impl_->targets_.end();
- for (detail::logger_impl::ListenerList::const_iterator it = impl_->targets_.begin(); it != itEnd; ++it)
- {
- (*it)->write(sev,msg,logId,impl_->procId_.c_str(),threadId);
- //(**it)(sev,logId,instance().procId_.c_str(),threadId,msg);
- }
- }
- void logger::setProcessId(const String& pId)
- {
- detail::logger_impl::scoped_lock lock;
- instance().impl_->procId_ = pId;
- }
- logger::logger() : impl_(new detail::logger_impl())
- {
- detail::logger_impl::scoped_lock lock;
- enableLog(0,true);
- for (severity_t i=0; i<S_LAST; ++i)
- enableSeverity( i, true );
- //addTarget(&toStdErr);
- }
- logger::~logger()
- {
- delete impl_;
- impl_ = 0;
- }
-
-} // logging
-} // yake
Deleted: branches/yake2/yake/src/base/yakeStderrLog.cpp
===================================================================
--- branches/yake2/yake/src/base/yakeStderrLog.cpp 2009-07-09 14:16:42 UTC (rev 1984)
+++ branches/yake2/yake/src/base/yakeStderrLog.cpp 2009-07-09 14:46:20 UTC (rev 1985)
@@ -1,61 +0,0 @@
-/*
- ------------------------------------------------------------------------------------
- This file is part of YAKE
- Copyright (c) 2004 - 2008 The YAKE Team
- For the latest information visit http://www.yake.org
- ------------------------------------------------------------------------------------
- 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 Lesser 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., 59 Temple
- Place - Suite 330, Boston, MA 02111-1307, USA, or go to
- http://www.gnu.org/copyleft/lesser.txt.
- ------------------------------------------------------------------------------------
- If you are interested in another license model contact the Yake Team via
- E-Mail: te...@ya....
- For more information see the LICENSE file in the root directory of the
- source code distribution.
- ------------------------------------------------------------------------------------
-*/
-#include <yake/base/yakePCH.h>
-#include <yake/base/yakeLog.h>
-#include <yake/base/yakeStderrLog.h>
-#include <yake/base/native/yakeNative.h>
-#include <boost/lexical_cast.hpp>
-#include <iostream>
-
-namespace yake {
-namespace logging {
-
- stderr_listener::stderr_listener()
- {
- }
- stderr_listener::~stderr_listener()
- {
- }
- void stderr_listener::write(const severity_t sev, const char* msg, const char* logId, const char* procId, threadid_t threadId)
- {
- std::ostringstream ss;
- formatLogMessage(ss, sev, msg, logId, procId, threadId );
-
- if (native::debug_Log_available()) //@todo potential performance problem
- native::debug_Log( ss.str(), sev );
- else
- std::cerr << ss.str();
- }
- log_listener_ptr stderr_listener::add()
- {
- log_listener_ptr l( new stderr_listener() );
- addListener( l.get() );
- return l;
- }
-
-} // logging
-} // yake
Copied: branches/yake2/yake/src/log/log.cpp (from rev 1982, branches/yake2/yake/src/base/yakeLog.cpp)
===================================================================
--- branches/yake2/yake/src/log/log.cpp (rev 0)
+++ branches/yake2/yake/src/log/log.cpp 2009-07-09 14:46:20 UTC (rev 1985)
@@ -0,0 +1,254 @@
+/*
+ ------------------------------------------------------------------------------------
+ This file is part of YAKE
+ Copyright (c) 2004 - 2008 The YAKE Team
+ For the latest information visit http://www.yake.org
+ ------------------------------------------------------------------------------------
+ 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 Lesser 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., 59 Temple
+ Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+ http://www.gnu.org/copyleft/lesser.txt.
+ ------------------------------------------------------------------------------------
+ If you are interested in another license model contact the Yake Team via
+ E-Mail: te...@ya....
+ For more information see the LICENSE file in the root directory of the
+ source code distribution.
+ ------------------------------------------------------------------------------------
+*/
+#include <yake/log/log.h>
+#include <boost/lexical_cast.hpp>
+#include <map>
+#include <boost/thread/recursive_mutex.hpp>
+#include <boost/thread/locks.hpp>
+#include <yake/log/detail/native.h>
+
+namespace yake {
+namespace native {
+#if YAKE_PLATFORM == PLATFORM_WIN32
+ struct LogConsole
+ {
+ static void Print( const char * text, WORD wAttributes )
+ {
+ //AllocConsole(); // this would actually open a console window...
+
+ HANDLE outHandle = GetStdHandle( STD_ERROR_HANDLE );
+ if (!outHandle)
+ return;
+
+ CONSOLE_SCREEN_BUFFER_INFO csbiInfo;
+ ::GetConsoleScreenBufferInfo( outHandle, &csbiInfo );
+
+ SetConsoleTextAttribute( outHandle, wAttributes );
+ DWORD dwWritten;
+ int length = (int)strlen( text );
+ ::BOOL bSuccess = WriteConsoleA( outHandle, text, ( DWORD )length, &dwWritten, 0 );
+ assert( bSuccess );
+
+ // restore settings
+ ::SetConsoleTextAttribute( outHandle, csbiInfo.wAttributes );
+ }
+ };
+ bool debug_Log_available()
+ {
+ return (GetStdHandle( STD_ERROR_HANDLE ) != 0);
+ }
+ void debug_Log( const std::string& what, logging::severity_t sev )
+ {
+ if (what.empty())
+ return;
+
+ // colour
+ WORD wAttributes = FOREGROUND_INTENSITY;
+ if (sev <= logging::S_ERROR)
+ wAttributes |= FOREGROUND_RED; // red
+ else if (sev <= logging::S_WARNING)
+ wAttributes |= FOREGROUND_GREEN | FOREGROUND_RED; // yellow
+ else if (sev < logging::S_LAST)
+ wAttributes |= FOREGROUND_GREEN; // green
+ else
+ wAttributes |= FOREGROUND_GREEN | FOREGROUND_RED; // yellow
+
+ LogConsole::Print( what.c_str(), wAttributes );
+ }
+ void debug_Print( const char * string )
+ {
+ LogConsole::Print( string, FOREGROUND_GREEN | FOREGROUND_BLUE | FOREGROUND_RED );
+ }
+#else // Linux etc:
+ bool debug_Log_available()
+ {
+ return true;
+ }
+ void debug_Log( const std::string& what, logging::severity_t sev )
+ {
+ if (sev <= logging::S_ERROR)
+ std::cout << "<error >";
+ else if (sev <= logging::S_WARNING)
+ std::cout << "<warning>";
+ else if (sev < logging::S_LAST)
+ std::cout << "<info >";
+ else
+ std::cout << "<custom >";
+ std::cout << what << "\n";
+ }
+ void debug_Print( const char* string )
+ {
+ std::cout << string << "\n";
+ }
+#endif
+} // namespace native
+namespace logging {
+ namespace detail {
+ struct logger_impl
+ {
+ String procId_;
+ typedef std::vector<log_listener*> ListenerList;
+ ListenerList targets_;
+ typedef std::map<severity_t,bool> EnableMap;
+ EnableMap enabledSeverities_;
+ typedef std::map<std::string,bool> EnableLogIdMap;
+ EnableLogIdMap enabledLogs_;
+ boost::recursive_mutex mtx_;
+ struct scoped_lock;
+ friend struct scoped_lock;
+ struct scoped_lock : public boost::noncopyable
+ {
+ scoped_lock();
+ private:
+ boost::recursive_mutex::scoped_lock lck_;
+ };
+ };
+ logger_impl::scoped_lock::scoped_lock() : lck_(logger::instance().impl_->mtx_)
+ {
+ }
+ } // detail
+
+ log_listener::~log_listener()
+ {
+ removeListener(this);
+ }
+
+ void formatLogMessage(std::ostream& out, const severity_t sev, const char* msg, const char* logId, const char* procId, threadid_t threadId)
+ {
+ out << "[" << (procId ? procId : "") << "]";
+
+ out << "[" << (logId ? logId : "") << "]";
+
+ out << "[";
+ out << std::hex << threadId;
+ out << "] ";
+
+ out << "[";
+ out << toString(Severity(sev));
+ if (sev >= S_LAST)
+ {
+ out << "(";
+ out << boost::lexical_cast<std::string>(sev);
+ out << ")";
+ }
+ out << "]";
+
+ out << " " << msg << "\n";
+ }
+
+ const char* toString(const Severity sev)
+ {
+ static char* severity_names[S_LAST+1] =
+ {
+ "emergency",
+ "alert",
+ "critical",
+ "error",
+ "warning",
+ "notice",
+ "information",
+ "debug",
+ "custom"
+ };
+ return (sev <= S_DEBUG) ? severity_names[sev] : severity_names[S_LAST];
+ }
+ logger logger::instance_;
+ logger& logger::instance()
+ {
+ return instance_;
+ }
+ void logger::enableSeverity(const severity_t sev, const bool on)
+ {
+ detail::logger_impl::scoped_lock lock;
+ this->impl_->enabledSeverities_[ sev ] = on;
+ }
+ void logger::enableLog(const char* logId, const bool on)
+ {
+ detail::logger_impl::scoped_lock lock;
+ instance().impl_->enabledLogs_[ std::string(logId ? logId : "") ] = on;
+ }
+ void logger::addListener(log_listener* l)
+ {
+ if (!l)
+ return;
+ detail::logger_impl::scoped_lock lock;
+ instance().impl_->targets_.push_back( l );
+ }
+ void logger::removeListener(log_listener* l)
+ {
+ if (!l)
+ return;
+ detail::logger_impl::scoped_lock lock;
+ if (instance().impl_->targets_.empty())
+ return;
+ instance().impl_->targets_.erase( std::find(instance().impl_->targets_.begin(), instance().impl_->targets_.end(), l) );
+ }
+ void logger::log(const severity_t sev, const char *logId, const char *msg)
+ {
+ instance().doLog(sev, logId, msg);
+ }
+ void logger::doLog(const severity_t sev, const char *logId, const char *msg)
+ {
+ detail::logger_impl::scoped_lock lock;
+
+ detail::logger_impl::EnableMap::const_iterator itEnabled = instance_.impl_->enabledSeverities_.find( sev );
+ if (itEnabled != instance_.impl_->enabledSeverities_.end() && !itEnabled->second)
+ return;
+
+ detail::logger_impl::EnableLogIdMap::const_iterator itLogEnabled = instance_.impl_->enabledLogs_.find( logId );
+ if (itLogEnabled != instance_.impl_->enabledLogs_.end() && !itLogEnabled->second)
+ return;
+
+ const threadid_t threadId = native::getCurrentThreadId();
+ detail::logger_impl::ListenerList::const_iterator itEnd = impl_->targets_.end();
+ for (detail::logger_impl::ListenerList::const_iterator it = impl_->targets_.begin(); it != itEnd; ++it)
+ {
+ (*it)->write(sev,msg,logId,impl_->procId_.c_str(),threadId);
+ //(**it)(sev,logId,instance().procId_.c_str(),threadId,msg);
+ }
+ }
+ void logger::setProcessId(const String& pId)
+ {
+ detail::logger_impl::scoped_lock lock;
+ instance().impl_->procId_ = pId;
+ }
+ logger::logger() : impl_(new detail::logger_impl())
+ {
+ detail::logger_impl::scoped_lock lock;
+ enableLog(0,true);
+ for (severity_t i=0; i<S_LAST; ++i)
+ enableSeverity( i, true );
+ //addTarget(&toStdErr);
+ }
+ logger::~logger()
+ {
+ delete impl_;
+ impl_ = 0;
+ }
+
+} // logging
+} // yake
Copied: branches/yake2/yake/src/log/log_file.cpp (from rev 1980, branches/yake2/yake/src/base/yakeFileLog.cpp)
===================================================================
--- branches/yake2/yake/src/log/log_file.cpp (rev 0)
+++ branches/yake2/yake/src/log/log_file.cpp 2009-07-09 14:46:20 UTC (rev 1985)
@@ -0,0 +1,68 @@
+/*
+ ------------------------------------------------------------------------------------
+ This file is part of YAKE
+ Copyright (c) 2004 - 2008 The YAKE Team
+ For the latest information visit http://www.yake.org
+ ------------------------------------------------------------------------------------
+ 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 Lesser 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., 59 Temple
+ Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+ http://www.gnu.org/copyleft/lesser.txt.
+ ------------------------------------------------------------------------------------
+ If you are interested in another license model contact the Yake Team via
+ E-Mail: te...@ya....
+ For more information see the LICENSE file in the root directory of the
+ source code distribution.
+ ------------------------------------------------------------------------------------
+*/
+#include <yake/log/log.h>
+#include <yake/log/log_file.h>
+#include <boost/lexical_cast.hpp>
+
+namespace yake {
+namespace logging {
+
+ file_listener::file_listener(const std::string& fileName)
+ {
+ fp_.open(fileName.c_str());
+ fp_ << "// format:\n";
+ fp_ << "// [processId][logId][threadId] [logLevel] message\n";
+ fp_.flush();
+ }
+ file_listener::~file_listener()
+ {
+ fp_.close();
+ }
+ void file_listener::write(const severity_t sev, const char* msg, const char* logId, const char* procId, threadid_t threadId)
+ {
+ formatLogMessage(fp_, sev, msg, logId, procId, threadId );
+ fp_.flush();
+ }
+ log_listener_ptr file_listener::add(const std::string& fileName)
+ {
+ log_listener_ptr l( new file_listener(fileName) );
+ addListener( l.get() );
+ return l;
+ }
+
+ //
+ void logToFile(const String& fileName)
+ {
+ static log_listener_ptr s_listener;
+ if (!s_listener)
+ {
+ s_listener.reset(new file_listener(fileName));
+ addListener( s_listener.get() );
+ }
+ }
+} // logging
+} // yake
Copied: branches/yake2/yake/src/log/log_stderr.cpp (from rev 1982, branches/yake2/yake/src/base/yakeStderrLog.cpp)
===================================================================
--- branches/yake2/yake/src/log/log_stderr.cpp (rev 0)
+++ branches/yake2/yake/src/log/log_stderr.cpp 2009-07-09 14:46:20 UTC (rev 1985)
@@ -0,0 +1,70 @@
+/*
+ ------------------------------------------------------------------------------------
+ This file is part of YAKE
+ Copyright (c) 2004 - 2008 The YAKE Team
+ For the latest information visit http://www.yake.org
+ ------------------------------------------------------------------------------------
+ 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 Lesser 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., 59 Temple
+ Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+ http://www.gnu.org/copyleft/lesser.txt.
+ ------------------------------------------------------------------------------------
+ If you are interested in another license model contact the Yake Team via
+ E-Mail: te...@ya....
+ For more information see the LICENSE file in the root directory of the
+ source code distribution.
+ ------------------------------------------------------------------------------------
+*/
+#include <yake/log/log.h>
+#include <yake/log/log_stderr.h>
+#include <yake/log/detail/native.h>
+#include <boost/lexical_cast.hpp>
+#include <iostream>
+
+namespace yake {
+namespace logging {
+
+ stderr_listener::stderr_listener()
+ {
+ }
+ stderr_listener::~stderr_listener()
+ {
+ }
+ void stderr_listener::write(const severity_t sev, const char* msg, const char* logId, const char* procId, threadid_t threadId)
+ {
+ std::ostringstream ss;
+ formatLogMessage(ss, sev, msg, logId, procId, threadId );
+
+ if (native::debug_Log_available()) //@todo potential performance problem
+ native::debug_Log( ss.str(), sev );
+ else
+ std::cerr << ss.str();
+ }
+ log_listener_ptr stderr_listener::add()
+ {
+ log_listener_ptr l( new stderr_listener() );
+ addListener( l.get() );
+ return l;
+ }
+
+ //
+ void logToStdErr()
+ {
+ static log_listener_ptr s_listener;
+ if (!s_listener)
+ {
+ s_listener.reset(new stderr_listener());
+ addListener( s_listener.get() );
+ }
+ }
+} // logging
+} // yake
Modified: branches/yake2/yake/yake/base/native/yakeNative.h
===================================================================
--- branches/yake2/yake/yake/base/native/yakeNative.h 2009-07-09 14:16:42 UTC (rev 1984)
+++ branches/yake2/yake/yake/base/native/yakeNative.h 2009-07-09 14:46:20 UTC (rev 1985)
@@ -31,7 +31,6 @@
#include <yake/base/yakePrerequisites.h>
#include <yake/base/yakeProcessor.h>
#include <yake/base/native/yakeThreads.h>
-#include <yake/base/yakeLog.h>
//============================================================================
@@ -46,9 +45,6 @@
// Debugging Interface.
YAKE_BASE_API bool debug_AssertFailed( const char* pszMessage, const char* pszCondition, const char* pszFile, int nLine, bool& rbIgnoreAlways );
- YAKE_BASE_API bool debug_Log_available();
- YAKE_BASE_API void debug_Log( const std::string& what, logging::severity_t );
- YAKE_BASE_API void debug_Print( const char* string );
// Critical Section Interface.
typedef const void* CriticalSectionHandle;
Modified: branches/yake2/yake/yake/base/yake.h
===================================================================
--- branches/yake2/yake/yake/base/yake.h 2009-07-09 14:16:42 UTC (rev 1984)
+++ branches/yake2/yake/yake/base/yake.h 2009-07-09 14:46:20 UTC (rev 1985)
@@ -50,9 +50,6 @@
#include "yakeVersion.h"
#include "yakeString.h"
#include "yakeException.h"
-#include "yakeLog.h"
-#include "yakeStderrLog.h"
-#include "yakeFileLog.h"
#include "yakeUniqueName.h"
#include "yakePlugin.h"
#include "yakeLibrary.h"
Deleted: branches/yake2/yake/yake/base/yakeFileLog.h
===================================================================
--- branches/yake2/yake/yake/base/yakeFileLog.h 2009-07-09 14:16:42 UTC (rev 1984)
+++ branches/yake2/yake/yake/base/yakeFileLog.h 2009-07-09 14:46:20 UTC (rev 1985)
@@ -1,50 +0,0 @@
-/*
- ------------------------------------------------------------------------------------
- This file is part of YAKE
- Copyright (c) 2004 - 2008 The YAKE Team
- For the latest information visit http://www.yake.org
- ------------------------------------------------------------------------------------
- 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 Lesser 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., 59 Temple
- Place - Suite 330, Boston, MA 02111-1307, USA, or go to
- http://www.gnu.org/copyleft/lesser.txt.
- ------------------------------------------------------------------------------------
- If you are interested in another license model contact the Yake Team via
- E-Mail: te...@ya....
- For more information see the LICENSE file in the root directory of the
- source code distribution.
- ------------------------------------------------------------------------------------
-*/
-#ifndef YAKE_LOGGING_FILE_LOG_H
-#define YAKE_LOGGING_FILE_LOG_H
-
-#include <yake/base/yakeLog.h>
-#include <fstream>
-
-namespace yake {
-namespace logging {
-
- struct YAKE_BASE_API file_listener : public log_listener
- {
- file_listener(const std::string& fileName);
- virtual ~file_listener();
- virtual void write(const severity_t sev, const char* msg, const char* logId, const char* procId, threadid_t threadId);
-
- static log_listener_ptr add(const std::string& fileName);
- private:
- std::ofstream fp_;
- };
-} // namespace logging
-} // namespace yake
-
-#endif // YAKE_LOGGING_FILE_LOG_H
-
Deleted: branches/yake2/yake/yake/base/yakeLog.h
===================================================================
--- branches/yake2/yake/yake/base/yakeLog.h 2009-07-09 14:16:42 UTC (rev 1984)
+++ branches/yake2/yake/yake/base/yakeLog.h 2009-07-09 14:46:20 UTC (rev 1985)
@@ -1,193 +0,0 @@
-/*
- ------------------------------------------------------------------------------------
- This file is part of YAKE
- Copyright (c) 2004 - 2008 The YAKE Team
- For the latest information visit http://www.yake.org
- ------------------------------------------------------------------------------------
- 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 Lesser 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., 59 Temple
- Place - Suite 330, Boston, MA 02111-1307, USA, or go to
- http://www.gnu.org/copyleft/lesser.txt.
- ------------------------------------------------------------------------------------
- If you are interested in another license model contact the Yake Team via
- E-Mail: te...@ya....
- For more information see the LICENSE file in the root directory of the
- source code distribution.
- ------------------------------------------------------------------------------------
-*/
-#ifndef YAKE_LOGGING_LOG_H
-#define YAKE_LOGGING_LOG_H
-
-#ifndef YAKE_BASE_PREREQUISITES_H
-# include "yake/base/yakePrerequisites.h"
-#endif
-#include <yake/base/yakeNoncopyable.h>
-#include <yake/base/yakeString.h>
-#include <yake/base/templates/yakePointer.h>
-#include <yake/base/native/yakeThreads.h>
-
-namespace yake {
-namespace logging {
-
- // syslog inspired
- enum Severity
- {
- S_EMERGENCY = 0,
- S_ALERT,
- S_CRITICAL,
- S_ERROR,
- S_WARNING,
- S_NOTICE,
- S_INFORMATION,
- S_DEBUG,
- S_LAST // Do not use directly.
- };
- typedef uint32 severity_t;
-
- //helper:
- YAKE_BASE_API const char* toString(const Severity sev);
- YAKE_BASE_API void formatLogMessage(std::ostream&, const severity_t sev, const char* msg, const char* logId, const char* procId, threadid_t threadId);
-
- /** */
- struct YAKE_BASE_API log_listener : public noncopyable
- {
- virtual ~log_listener();
- virtual void write(const severity_t sev, const char* msg, const char* logId, const char* procId, threadid_t threadId) = 0;
- };
- typedef SharedPtr<log_listener> log_listener_ptr;
-
- namespace detail {
- struct logger_impl;
- } // detail
-
- /** */
- struct YAKE_BASE_API logger : public noncopyable
- {
- friend struct detail::logger_impl;
- //YAKE_BUILD_PHOENIX_SINGLETON(logger) //public
- private: //Make it private if PHOENIX is not used!
- logger();
- ~logger();
- static logger instance_;
- public:
- static logger& instance();
- //static void log(const severity_t, const char* env, const char* src, const char* msg);
- void log(const severity_t, const char* logId, const char* msg);
- void setProcessId(const String&);
-
- /** @note Ownership is not transferred! */
- void addListener(log_listener*);
- void removeListener(log_listener*);
-
- void enableSeverity(const severity_t, const bool);
- void enableLog(const char* logId, const bool);
- private:
- //void doLog(const severity_t, const char* env, const char* msg);
- void doLog(const severity_t, const char* logId, const char* msg);
- private:
- detail::logger_impl* impl_;
- };
-
- ////////////////
-#if defined(LOG_WITH_TYPE)
-# define LOG_TYPE(X) typeid(X).name() << "(" << X << ")"
-#else
-# define LOG_TYPE(X) X
-#endif
-
- template<typename T1>
- inline void log(const severity_t sev, const char* logId, const T1& rhs)
- {
- std::stringstream ss;
- ss << LOG_TYPE(rhs);
- logger::instance().log(sev, logId, ss.str().c_str());
- }
- template<typename T1, typename T2>
- inline void log(const severity_t sev, const char* logId, const T1& rhs1, const T2& rhs2)
- {
- std::stringstream ss;
- ss << LOG_TYPE(rhs1);
- ss << LOG_TYPE(rhs2);
- logger::instance().log(sev, logId, ss.str().c_str());
- }
- template<typename T1, typename T2, typename T3>
- inline void log(const severity_t sev, const char* logId, const T1& rhs1, const T2& rhs2, const T3& rhs3)
- {
- std::stringstream ss;
- ss << LOG_TYPE(rhs1);
- ss << LOG_TYPE(rhs2);
- ss << LOG_TYPE(rhs3);
- logger::instance().log(sev, logId, ss.str().c_str());
- }
-
- // short cuts
- inline void setProcessId(const String& procId)
- {
- logger::instance().setProcessId(procId);
- }
- inline void enableSeverity(const severity_t sev, const bool on)
- {
- logger::instance().enableSeverity(sev,on);
- }
- inline void enableLog(const char* logId, const bool on)
- {
- logger::instance().enableLog(logId,on);
- }
- inline void addListener(log_listener* l)
- {
- logger::instance().addListener(l);
- }
- inline void removeListener(log_listener* l)
- {
- logger::instance().removeListener(l);
- }
-
- // helper stream operators
- inline std::ostream& operator << (std::ostream& out, const std::exception& rhs)
- {
- out << "std::exception('" << rhs.what() << "')";
- return out;
- }
-
- /////////////////
- // Compatibility
- // @todo remove in 0.7.x
-
- // some preprocessor magic for __LINE__ stringification
- // Unfortunately it doesn't produce correct results on VC7.1.
- #define STRINGIFY(x) #x
- #if YAKE_PLATFORM == PLATFORM_WIN32
- inline String TOSTRING2FN(int i)
- {
- std::stringstream ss;
- ss << i;
- return String( ss.str().c_str() );
- }
- # define TOSTRING(x) +::yake::logging::TOSTRING2FN(x)
- #else
- # define TOSTRING(x) STRINGIFY (x)
- #endif
-
- #define YAKE_LOG_X_BASE( LOGID, LOGLVL, WHAT ) \
- { \
- std::stringstream ss; ss << WHAT; \
- yake::logging::log( LOGLVL, LOGID, ss.str() ); \
- }
- #define YAKE_LOG_INFORMATION( LOGID, WHAT ) YAKE_LOG_X_BASE( LOGID, yake::logging::S_INFORMATION, WHAT )
- #define YAKE_LOG_WARNING( LOGID, WHAT ) YAKE_LOG_X_BASE( LOGID, yake::logging::S_WARNING, WHAT )
- #define YAKE_LOG_ERROR( LOGID, WHAT ) YAKE_LOG_X_BASE( LOGID, yake::logging::S_ERROR, WHAT )
- #define YAKE_LOG( LOGID, WHAT ) YAKE_LOG_X_BASE( LOGID, yake::logging::S_INFORMATION, WHAT );
-} // namespace logging
-} // namespace yake
-
-#endif // YAKE_LOGGING_LOG_H
-
Deleted: branches/yake2/yake/yake/base/yakeStderrLog.h
===================================================================
--- branches/yake2/yake/yake/base/yakeStderrLog.h 2009-07-09 14:16:42 UTC (rev 1984)
+++ branches/yake2/yake/yake/base/yakeStderrLog.h 2009-07-09 14:46:20 UTC (rev 1985)
@@ -1,50 +0,0 @@
-/*
- ------------------------------------------------------------------------------------
- This file is part of YAKE
- Copyright (c) 2004 - 2008 The YAKE Team
- For the latest information visit http://www.yake.org
- ------------------------------------------------------------------------------------
- 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 Lesser 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., 59 Temple
- Place - Suite 330, Boston, MA 02111-1307, USA, or go to
- http://www.gnu.org/copyleft/lesser.txt.
- ------------------------------------------------------------------------------------
- If you are interested in another license model contact the Yake Team via
- E-Mail: te...@ya....
- For more information see the LICENSE file in the root directory of the
- source code distribution.
- ------------------------------------------------------------------------------------
-*/
-#ifndef YAKE_LOGGING_STDERR_LOG_H
-#define YAKE_LOGGING_STDERR_LOG_H
-
-#include <yake/base/yakeLog.h>
-#include <fstream>
-
-namespace yake {
-namespace logging {
-
- /** */
- struct YAKE_BASE_API stderr_listener : public log_listener
- {
- stderr_listener();
- virtual ~stderr_listener();
- virtual void write(const severity_t sev, const char* msg, const char* logId, const char* procId, threadid_t threadId);
-
- static log_listener_ptr add();
- };
-
-} // namespace logging
-} // namespace yake
-
-#endif // YAKE_LOGGING_STDERR_LOG_H
-
Added: branches/yake2/yake/yake/base/yakeStringMap.h
===================================================================
--- branches/yake2/yake/yake/base/yakeStringMap.h (rev 0)
+++ branches/yake2/yake/yake/base/yakeStringMap.h 2009-07-09 14:46:20 UTC (rev 1985)
@@ -0,0 +1,59 @@
+/*
+ ------------------------------------------------------------------------------------
+ This file is part of YAKE
+ Copyright (c) 2004 - 2008 The YAKE Team
+ For the latest information visit http://www.yake.org
+ ------------------------------------------------------------------------------------
+ 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 Lesser 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., 59 Temple
+ Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+ http://www.gnu.org/copyleft/lesser.txt.
+ ------------------------------------------------------------------------------------
+ If you are interested in another license model contact the Yake Team via
+ E-Mail: te...@ya....
+ For more information see the LICENSE file in the root directory of the
+ source code distribution.
+ ------------------------------------------------------------------------------------
+*/
+#ifndef YAKE_BASE_STRINGMAP_H
+#define YAKE_BASE_STRINGMAP_H
+
+#include <yake/base/yakePrerequisites.h>
+namespace yake {
+
+ typedef std::map<String,String> StringMap;
+ struct YAKE_BASE_API MakeStringMap
+ {
+ MakeStringMap & operator<<(const StringPair& stringPair)
+ {
+ m_map.insert( stringPair );
+ return *this;
+ }
+ operator StringMap()
+ {
+ return m_map;
+ }
+ private:
+ StringMap m_map;
+ };
+ inline std::ostream& operator << (std::ostream& out, const StringMap& rhs)
+ {
+ out << "StringMap(";
+ for (StringMap::const_iterator it = rhs.begin(); it != rhs.end(); ++it)
+ {
+ out << ((it == rhs.begin()) ? "" : ";")
+ << it->first << "=" << it->second;
+ }
+ out << ")";
+ return out;
+ }
+} // yake
Added: branches/yake2/yake/yake/log/detail/native.h
===================================================================
--- branches/yake2/yake/yake/log/detail/native.h (rev 0)
+++ branches/yake2/yake/yake/log/detail/native.h 2009-07-09 14:46:20 UTC (rev 1985)
@@ -0,0 +1,11 @@
+#ifndef YAKE_LOGGING_NATIVE_H
+#define YAKE_LOGGING_NATIVE_H
+
+namespace yake {
+namespace native {
+ bool debug_Log_available();
+ void debug_Log( const std::string& what, logging::severity_t sev );
+} // namespace native
+} // namespace yake
+
+#endif
Copied: branches/yake2/yake/yake/log/log.h (from rev 1982, branches/yake2/yake/yake/base/yakeLog.h)
===================================================================
--- branches/yake2/yake/yake/log/log.h (rev 0)
+++ branches/yake2/yake/yake/log/log.h 2009-07-09 14:46:20 UTC (rev 1985)
@@ -0,0 +1,203 @@
+/*
+ ------------------------------------------------------------------------------------
+ This file is part of YAKE
+ Copyright (c) 2004 - 2008 The YAKE Team
+ For the latest information visit http://www.yake.org
+ ------------------------------------------------------------------------------------
+ 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 Lesser 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., 59 Temple
+ Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+ http://www.gnu.org/copyleft/lesser.txt.
+ ------------------------------------------------------------------------------------
+ If you are interested in another license model contact the Yake Team via
+ E-Mail: te...@ya....
+ For more information see the LICENSE file in the root directory of the
+ source code distribution.
+ ------------------------------------------------------------------------------------
+*/
+#ifndef YAKE_LOGGING_LOG_H
+#define YAKE_LOGGING_LOG_H
+
+#ifndef YAKE_BASE_PREREQUISITES_H
+# include <yake/base/yakePrerequisites.h>
+#endif
+#include <yake/base/yakeNoncopyable.h>
+#include <yake/base/yakeString.h>
+#include <yake/base/templates/yakePointer.h>
+#include <yake/base/native/yakeThreads.h>
+
+#ifdef YAKE_LOG_EXPORTS
+# define YAKE_LOG_API YAKE_EXPORT_API
+#else
+# define YAKE_LOG_API YAKE_IMPORT_API
+#endif
+
+namespace yake {
+namespace logging {
+
+ // syslog inspired
+ enum Severity
+ {
+ S_EMERGENCY = 0,
+ S_ALERT,
+ S_CRITICAL,
+ S_ERROR,
+ S_WARNING,
+ S_NOTICE,
+ S_INFORMATION,
+ S_DEBUG,
+ S_LAST // Do not use directly.
+ };
+ typedef uint32 severity_t;
+
+ //helper:
+ YAKE_LOG_API const char* toString(const Severity sev);
+ YAKE_LOG_API void formatLogMessage(std::ostream&, const severity_t sev, const char* msg, const char* logId, const char* procId, threadid_t threadId);
+
+ /** */
+ struct YAKE_LOG_API log_listener : public noncopyable
+ {
+ virtual ~log_listener();
+ virtual void write(const severity_t sev, const char* msg, const char* logId, const char* procId, threadid_t threadId) = 0;
+ };
+ typedef SharedPtr<log_listener> log_listener_ptr;
+
+ namespace detail {
+ struct logger_impl;
+ } // detail
+
+ /** */
+ struct YAKE_LOG_API logger : public noncopyable
+ {
+ friend struct detail::logger_impl;
+ //YAKE_BUILD_PHOENIX_SINGLETON(logger) //public
+ private: //Make it private if PHOENIX is not used!
+ logger();
+ ~logger();
+ static logger instance_;
+ public:
+ static logger& instance();
+ //static void log(const severity_t, const char* env, const char* src, const char* msg);
+ void log(const severity_t, const char* logId, const char* msg);
+ void setProcessId(const String&);
+
+ /** @note Ownership is not transferred! */
+ void addListener(log_listener*);
+ void removeListener(log_listener*);
+
+ void enableSeverity(const severity_t, const bool);
+ void enableLog(const char* logId, const bool);
+ private:
+ //void doLog(const severity_t, const char* env, const char* msg);
+ void doLog(const severity_t, const char* logId, const char* msg);
+ private:
+ detail::logger_impl* impl_;
+ };
+
+ ////////////////
+#if defined(LOG_WITH_TYPE)
+# define LOG_TYPE(X) typeid(X).name() << "(" << X << ")"
+#else
+# define LOG_TYPE(X) X
+#endif
+
+ template<typename T1>
+ inline void log(const severity_t sev, const char* logId, const T1& rhs)
+ {
+ std::stringstream ss;
+ ss << LOG_TYPE(rhs);
+ logger::instance().log(sev, logId, ss.str().c_str());
+ }
+ template<typename T1, typename T2>
+ inline void log(const severity_t sev, const char* logId, const T1& rhs1, const T2& rhs2)
+ {
+ std::stringstream ss;
+ ss << LOG_TYPE(rhs1);
+ ss << LOG_TYPE(rhs2);
+ logger::instance().log(sev, logId, ss.str().c_str());
+ }
+ template<typename T1, typename T2, typename T3>
+ inline void log(const severity_t sev, const char* logId, const T1& rhs1, const T2& rhs2, const T3& rhs3)
+ {
+ std::stringstream ss;
+ ss << LOG_TYPE(rhs1);
+ ss << LOG_TYPE(rhs2);
+ ss << LOG_TYPE(rhs3);
+ logger::instance().log(sev, logId, ss.str().c_str());
+ }
+
+ // short cuts
+ inline void setProcessId(const String& procId)
+ {
+ logger::instance().setProcessId(procId);
+ }
+ inline void enableSeverity(const severity_t sev, const bool on)
+ {
+ logger::instance().enableSeverity(sev,on);
+ }
+ inline void enableLog(const char* logId, const bool on)
+ {
+ logger::instance().enableLog(logId,on);
+ }
+ inline void addListener(log_listener* l)
+ {
+ logger::instance().addListener(l);
+ }
+ inline void removeListener(log_listener* l)
+ {
+ logger::instance().removeListener(l);
+ }
+
+ // for convenience:
+ YAKE_LOG_API void logToFile(const String& fileName);
+ YAKE_LOG_API void logToStdErr();
+
+ // helper stream operators
+ inline std::ostream& operator << (std::ostream& out, const std::exception& rhs)
+ {
+ out << "std::exception('" << rhs.what() << "')";
+ return out;
+ }
+
+ /////////////////
+ // Compatibility
+ // @todo remove in 0.7.x
+
+ // some preprocessor magic for __LINE__ stringification
+ // Unfortunately it doesn't produce correct results on VC7.1.
+ #define STRINGIFY(x) #x
+ #if YAKE_PLATFORM == PLATFORM_WIN32
+ inline String TOSTRING2FN(int i)
+ {
+ std::stringstream ss;
+ ss << i;
+ return String( ss.str().c_str() );
+ }
+ # define TOSTRING(x) +::yake::logging::TOSTRING2FN(x)
+ #else
+ # define TOSTRING(x) STRINGIFY (x)
+ #endif
+
+ #define YAKE_LOG_X_BASE( LOGID, LOGLVL, WHAT ) \
+ { \
+ std::stringstream ss; ss << WHAT; \
+ yake::logging::log( LOGLVL, LOGID, ss.str() ); \
+ }
+ #define YAKE_LOG_INFORMATION( LOGID, WHAT ) YAKE_LOG_X_BASE( LOGID, yake::logging::S_INFORMATION, WHAT )
+ #define YAKE_LOG_WARNING( LOGID, WHAT ) YAKE_LOG_X_BASE( LOGID, yake::logging::S_WARNING, WHAT )
+ #define YAKE_LOG_ERROR( LOGID, WHAT ) YAKE_LOG_X_BASE( LOGID, yake::logging::S_ERROR, WHAT )
+ #define YAKE_LOG( LOGID, WHAT ) YAKE_LOG_X_BASE( LOGID, yake::logging::S_INFORMATION, WHAT );
+} // namespace logging
+} // namespace yake
+
+#endif // YAKE_LOGGING_LOG_H
+
Copied: branches/yake2/yake/yake/log/log_file.h (from rev 1980, branches/yake2/yake/yake/base/yakeFileLog.h)
===================================================================
--- branches/yake2/yake/yake/log/log_file.h (rev 0)
+++ branches/yake2/yake/yake/log/log_file.h 2009-07-09 14:46:20 UTC (rev 1985)
@@ -0,0 +1,50 @@
+/*
+ ------------------------------------------------------------------------------------
+ This file is part of YAKE
+ Copyright (c) 2004 - 2008 The YAKE Team
+ For the latest information visit http://www.yake.org
+ ------------------------------------------------------------------------------------
+ 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 Lesser 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., 59 Temple
+ Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+ http://www.gnu.org/copyleft/lesser.txt.
+ ------------------------------------------------------------------------------------
+ If you are interested in another license model contact the Yake Team via
+ E-Mail: te...@ya....
+ For more information see the LICENSE file in the root directory of the
+ source code distribution.
+ ------------------------------------------------------------------------------------
+*/
+#ifndef YAKE_LOGGING_FILE_LOG_H
+#define YAKE_LOGGING_FILE_LOG_H
+
+#include <yake/log/log.h>
+#include <fstream>
+
+namespace yake {
+namespace logging {
+
+ struct YAKE_LOG_API file_listener : public log_listener
+ {
+ file_listener(const std::string& fileName);
+ virtual ~file_listener();
+ virtual void write(const severity_t sev, const char* msg, const char* logId, const char* procId, threadid_t threadId);
+
+ static log_listener_ptr add(const std::string& fileName);
+ private:
+ std::ofstream fp_;
+ };
+} // namespace logging
+} // namespace yake
+
+#endif // YAKE_LOGGING_FILE_LOG_H
+
Copied: branches/yake2/yake/yake/log/log_stderr.h (from rev 1980, branches/yake2/yake/yake/base/yakeStderrLog.h)
===================================================================
--- branches/yake2/yake/yake/log/log_stderr.h (rev 0)
+++ branches/yake2/yake/yake/log/log_stderr.h 2009-07-09 14:46:20 UTC (rev 1985)
@@ -0,0 +1,49 @@
+/*
+ ------------------------------------------------------------------------------------
+ This file is part of YAKE
+ Copyright (c) 2004 - 2008 The YAKE Team
+ For the latest information visit http://www.yake.org
+ ------------------------------------------------------------------------------------
+ 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 Lesser 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., 59 Temple
+ Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+ http://www.gnu.org/copyleft/lesser.txt.
+ ------------------------------------------------------------------------------------
+ If you are interested in another license model contact the Yake Team via
+ E-Mail: te...@ya....
+ For more information see the LICENSE file in the root directory of the
+ source code distribution.
+ ------------------------------------------------------------------------------------
+*/
+#ifndef YAKE_LOGGING_STDERR_LOG_H
+#define YAKE_LOGGING_STDERR_LOG_H
+
+#include <yake/log/log.h>
+
+namespace yake {
+namespace logging {
+
+ /** */
+ struct YAKE_LOG_API stderr_listener : public log_listener
+ {
+ stderr_listener();
+ virtual ~stderr_listener();
+ virtual void write(const severity_t sev, const char* msg, const char* logId, const char* procId, threadid_t threadId);
+
+ static log_listener_ptr add();
+ };
+
+} // namespace logging
+} // namespace yake
+
+#endif // YAKE_LOGGING_STDERR_LOG_H
+
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <psy...@us...> - 2009-07-09 14:16:44
|
Revision: 1984
http://yake.svn.sourceforge.net/yake/?rev=1984&view=rev
Author: psyclonist
Date: 2009-07-09 14:16:42 +0000 (Thu, 09 Jul 2009)
Log Message:
-----------
added directories
Added Paths:
-----------
branches/yake2/yake/src/log/
branches/yake2/yake/yake/log/
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <psy...@us...> - 2009-07-09 14:13:57
|
Revision: 1983
http://yake.svn.sourceforge.net/yake/?rev=1983&view=rev
Author: psyclonist
Date: 2009-07-09 14:13:56 +0000 (Thu, 09 Jul 2009)
Log Message:
-----------
build: use "yake_" prefix for libraries and added demo settings
Modified Paths:
--------------
branches/yake2/yake/premake4.lua
Added Paths:
-----------
branches/yake2/yake/samples/log1/
Removed Paths:
-------------
branches/yake2/yake/samples/sampleLog/
Modified: branches/yake2/yake/premake4.lua
===================================================================
--- branches/yake2/yake/premake4.lua 2009-06-24 18:34:06 UTC (rev 1982)
+++ branches/yake2/yake/premake4.lua 2009-07-09 14:13:56 UTC (rev 1983)
@@ -6,7 +6,7 @@
DEP_DIR = ROOT_DIR .. "dependencies/"
DEBUG_DLL_SUFFIX = "dll"
-LIBFILE_PREFIX = ""
+YAKE_LIBFILE_PREFIX = "yake_"
YAKE_LUA_BINDINGS = true
ENABLE_LUA_BASE = true
@@ -21,10 +21,10 @@
includedirs = { DEP_DIR .. "lua" },
libdirs = { DEP_DIR .. "lua/lib" },
links = {
- ["Debug"] = { "lua5.1d" },
+ --["Debug"] = { "lua5.1d" },
["DebugLib"] = { "lua5.1d" },
["DebugDLL"] = { "lua5.1d" },
- ["Release"] = { "lua5.1" },
+ --["Release"] = { "lua5.1" },
["ReleaseLib"] = { "lua5.1" },
["ReleaseDLL"] = { "lua5.1" },
}
@@ -124,6 +124,7 @@
--assert( os.isdir(dest_path), "Could not create directory: "..dest_path )
local source_path = "build/".._OPTIONS["toolset"].."/bin/"
+ -- libs ...
local files = os.matchfiles(source_path .. "*.dll")
for _,v in pairs(files) do
print("Copy",v,dest_path .. path.getname(v))
@@ -139,6 +140,13 @@
print("Copy",v,dest_path .. path.getname(v))
os.copyfile(v,dest_path .. path.getname(v))
end
+
+ -- samples
+ files = os.matchfiles(source_path .. "*.exe")
+ for _,v in pairs(files) do
+ print("Copy",v,dest_path .. path.getname(v))
+ os.copyfile(v,dest_path .. path.getname(v))
+ end
end
}
@@ -175,7 +183,7 @@
f:write("#define YAKE_CONFIG_H\n")
f:write("\n")
f:write("#define YAKE_DEBUG_DLL_SUFFIX \"" .. DEBUG_DLL_SUFFIX .. "\"\n")
- f:write("#define YAKE_LIBFILE_PREFIX \"" .. LIBFILE_PREFIX .. "\"\n")
+ f:write("#define YAKE_LIBFILE_PREFIX \"" .. YAKE_LIBFILE_PREFIX .. "\"\n")
f:write("#define YAKE_LUA_BINDINGS " .. bool_to_int(LUA_BINDINGS) .. "\n")
f:write("#define YAKE_ENABLE_LUA_BASE " .. bool_to_int(ENABLE_LUA_BASE) .. "\n")
--[[
@@ -216,14 +224,14 @@
objdir ( ROOT_DIR .. "build/" .. _ACTION .. "/obj" )
if os.is("windows") then -- TODO actually it's "is VC++"
- configuration { "Debug", "DebugDLL", "DebugLib", "Release", "ReleaseDLL", "ReleaseLib" }
+ configuration { "DebugDLL", "DebugLib", "ReleaseDLL", "ReleaseLib" }
defines { "NOMINMAX", "WIN32_LEAN_AND_MEAN" }
end
- configuration { "Debug", "DebugDLL", "DebugLib" }
+ configuration { "DebugDLL", "DebugLib" }
defines { "_DEBUG" }
flags { "Symbols" }
- configuration { "Release", "ReleaseDLL", "ReleaseLib" }
+ configuration { "ReleaseDLL", "ReleaseLib" }
defines { "NDEBUG" }
flags { "Optimize" }
-- dynamic targets:
@@ -272,20 +280,20 @@
if opt.files then files(opt.files) end
configuration "ReleaseDLL"
- targetname(name.."_"..mapActionToCompilerName[_ACTION])
+ targetname(YAKE_LIBFILE_PREFIX.. name.."_"..mapActionToCompilerName[_ACTION])
defines { "YAKE_" .. name:upper() .. "_EXPORTS" }
require_package_links( "ReleaseDLL", opt.require_package )
if os.is("windows") then links { "winmm" } end -- for timeGetTime
configuration "DebugDLL"
- targetname(name.."_"..mapActionToCompilerName[_ACTION].."_d")
+ targetname(YAKE_LIBFILE_PREFIX.. name.."_"..mapActionToCompilerName[_ACTION].."_d")
defines { "YAKE_" .. name:upper() .. "_EXPORTS" }
require_package_links( "DebugDLL", opt.require_package )
if os.is("windows") then links { "winmm" } end -- for timeGetTime
configuration "ReleaseLib"
- targetname(name.."_"..mapActionToCompilerName[_ACTION].."_s")
+ targetname(YAKE_LIBFILE_PREFIX.. name.."_"..mapActionToCompilerName[_ACTION].."_s")
require_package_links( "ReleaseLib", opt.require_package )
configuration "DebugLib"
- targetname(name.."_"..mapActionToCompilerName[_ACTION].."_sd")
+ targetname(YAKE_LIBFILE_PREFIX.. name.."_"..mapActionToCompilerName[_ACTION].."_sd")
require_package_links( "DebugLib", opt.require_package )
end
local function project_lib(name,opt)
@@ -305,12 +313,23 @@
assert(name,"no name specified for project_lib")
project(name)
location ( ROOT_DIR .. "build/" .. _ACTION )
+ targetdir ( ROOT_DIR .. "build/" .. _ACTION .. "/bin" )
language "C++"
kind "ConsoleApp"
- files { ROOT_DIR .. "src/"..name.."/**.cpp", ROOT_DIR .. "yake/"..name.."/**.h" }
- links { "base" }
- configuration "Debug"
- configuration "Release"
+ files { ROOT_DIR .. "samples/"..name.."/**.cpp", ROOT_DIR .. "samples/"..name.."/**.h" }
+
+ -- general include base directory
+ includedirs { ROOT_DIR }
+
+ -- basic dependencies (boost)
+ require_package_incs { "boost" }
+
+ requires_lib "base"
+
+ configuration "DebugDLL"
+ targetname(name.."_d")
+ configuration "ReleaseDLL"
+ targetname(name)
end
project_lib_basic( "base",
{ files = { ROOT_DIR .. "src/base/*.cpp", ROOT_DIR .. "src/base/math/*.cpp", ROOT_DIR .. "src/base/templates/*.cpp",
@@ -334,7 +353,7 @@
for k,v in pairs(_OPTIONS) do print("OPT",k,v) end
if not _OPTIONS["without-demos"] then
- project_exe "demo2"
+ project_exe "log1"
requires_lib "base"
end
--[[
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <psy...@us...> - 2009-06-24 18:34:08
|
Revision: 1982
http://yake.svn.sourceforge.net/yake/?rev=1982&view=rev
Author: psyclonist
Date: 2009-06-24 18:34:06 +0000 (Wed, 24 Jun 2009)
Log Message:
-----------
build time optimization: refactored include order and refactored yakeLog.h not pull in boost threads headers. -> results in reduction of 45sec to 28sec on test machine for project 'base' (target: DebugDLL).
Modified Paths:
--------------
branches/yake2/yake/src/base/math/yakeMath.cpp
branches/yake2/yake/src/base/math/yakeVolume.cpp
branches/yake2/yake/src/base/templates/yakeSmartAssert.cpp
branches/yake2/yake/src/base/templates/yakeSmartAssertHandlers.cpp
branches/yake2/yake/src/base/yakeConfigFile.cpp
branches/yake2/yake/src/base/yakeLog.cpp
branches/yake2/yake/src/base/yakeParamHolder.cpp
branches/yake2/yake/src/base/yakeStderrLog.cpp
branches/yake2/yake/src/base/yakeString.cpp
branches/yake2/yake/src/base/yakeUniqueId.cpp
branches/yake2/yake/yake/base/math/yakeMath.h
branches/yake2/yake/yake/base/math/yakeMersenneTwister.h
branches/yake2/yake/yake/base/math/yakeVector3.h
branches/yake2/yake/yake/base/math/yakeVolume.h
branches/yake2/yake/yake/base/templates/yakeManager.h
branches/yake2/yake/yake/base/templates/yakeSignals.h
branches/yake2/yake/yake/base/templates/yakeSingleton.h
branches/yake2/yake/yake/base/templates/yakeSmartAssert.h
branches/yake2/yake/yake/base/yake.h
branches/yake2/yake/yake/base/yakeDataChunk.h
branches/yake2/yake/yake/base/yakeLog.h
branches/yake2/yake/yake/base/yakePCH.h
branches/yake2/yake/yake/base/yakeParamHolder.h
branches/yake2/yake/yake/base/yakePrerequisites.h
branches/yake2/yake/yake/base/yakeString.h
Removed Paths:
-------------
branches/yake2/yake/src/base/yakeMimeTypeManager.cpp
branches/yake2/yake/yake/base/templates/yakeDeque.h
branches/yake2/yake/yake/base/templates/yakeFastMap.h
branches/yake2/yake/yake/base/yakeMimeTypeManager.h
Modified: branches/yake2/yake/src/base/math/yakeMath.cpp
===================================================================
--- branches/yake2/yake/src/base/math/yakeMath.cpp 2009-06-24 18:32:09 UTC (rev 1981)
+++ branches/yake2/yake/src/base/math/yakeMath.cpp 2009-06-24 18:34:06 UTC (rev 1982)
@@ -31,6 +31,7 @@
#include <yake/base/math/yakeMath.h>
#include <stdlib.h> // for RAND_MAX
+#include <ctime>
#define FORCEINLINE inline
#include <yake/base/math/yakeAsmMath.h>
Modified: branches/yake2/yake/src/base/math/yakeVolume.cpp
===================================================================
--- branches/yake2/yake/src/base/math/yakeVolume.cpp 2009-06-24 18:32:09 UTC (rev 1981)
+++ branches/yake2/yake/src/base/math/yakeVolume.cpp 2009-06-24 18:34:06 UTC (rev 1982)
@@ -27,6 +27,7 @@
#include <yake/base/yakePCH.h>
#include <yake/base/math/yakeVolume.h>
+#include <yake/base/templates/yakeSmartAssert.h>
namespace yake {
Modified: branches/yake2/yake/src/base/templates/yakeSmartAssert.cpp
===================================================================
--- branches/yake2/yake/src/base/templates/yakeSmartAssert.cpp 2009-06-24 18:32:09 UTC (rev 1981)
+++ branches/yake2/yake/src/base/templates/yakeSmartAssert.cpp 2009-06-24 18:34:06 UTC (rev 1982)
@@ -32,6 +32,7 @@
#include <yake/base/native/yakeNative.h>
#include <boost/function.hpp>
#include <yake/base/templates/yakeSmartAssertHandlers.h>
+#include <iostream>
//============================================================================
// INTERFACE STRUCTURES / UTILITY CLASSES
Modified: branches/yake2/yake/src/base/templates/yakeSmartAssertHandlers.cpp
===================================================================
--- branches/yake2/yake/src/base/templates/yakeSmartAssertHandlers.cpp 2009-06-24 18:32:09 UTC (rev 1981)
+++ branches/yake2/yake/src/base/templates/yakeSmartAssertHandlers.cpp 2009-06-24 18:34:06 UTC (rev 1982)
@@ -27,6 +27,7 @@
#include <yake/base/yakePCH.h>
#include <yake/base/templates/yakeSmartAssertHandlers.h>
#include <yake/base/native/yakeNative.h>
+#include <iostream>
namespace yake {
namespace assert {
Modified: branches/yake2/yake/src/base/yakeConfigFile.cpp
===================================================================
--- branches/yake2/yake/src/base/yakeConfigFile.cpp 2009-06-24 18:32:09 UTC (rev 1981)
+++ branches/yake2/yake/src/base/yakeConfigFile.cpp 2009-06-24 18:34:06 UTC (rev 1982)
@@ -27,6 +27,7 @@
#include <yake/base/yakePCH.h>
#include <yake/base/yakeConfigFile.h>
+#include <yake/base/templates/yakeSmartAssert.h>
namespace yake {
Modified: branches/yake2/yake/src/base/yakeLog.cpp
===================================================================
--- branches/yake2/yake/src/base/yakeLog.cpp 2009-06-24 18:32:09 UTC (rev 1981)
+++ branches/yake2/yake/src/base/yakeLog.cpp 2009-06-24 18:34:06 UTC (rev 1982)
@@ -28,9 +28,37 @@
#include <yake/base/yakeLog.h>
#include <yake/base/native/yakeNative.h>
#include <boost/lexical_cast.hpp>
+#include <map>
+#include <boost/thread/recursive_mutex.hpp>
+#include <boost/thread/locks.hpp>
namespace yake {
namespace logging {
+ namespace detail {
+ struct logger_impl
+ {
+ String procId_;
+ typedef std::vector<log_listener*> ListenerList;
+ ListenerList targets_;
+ typedef std::map<severity_t,bool> EnableMap;
+ EnableMap enabledSeverities_;
+ typedef std::map<std::string,bool> EnableLogIdMap;
+ EnableLogIdMap enabledLogs_;
+ boost::recursive_mutex mtx_;
+ struct scoped_lock;
+ friend struct scoped_lock;
+ struct scoped_lock : public boost::noncopyable
+ {
+ scoped_lock();
+ private:
+ boost::recursive_mutex::scoped_lock lck_;
+ };
+ };
+ logger_impl::scoped_lock::scoped_lock() : lck_(logger::instance().impl_->mtx_)
+ {
+ }
+ } // detail
+
log_listener::~log_listener()
{
removeListener(this);
@@ -75,9 +103,6 @@
};
return (sev <= S_DEBUG) ? severity_names[sev] : severity_names[S_LAST];
}
- logger::scoped_lock::scoped_lock() : lck_(instance_.mtx_)
- {
- }
logger logger::instance_;
logger& logger::instance()
{
@@ -85,29 +110,29 @@
}
void logger::enableSeverity(const severity_t sev, const bool on)
{
- scoped_lock lock;
- this->enabledSeverities_[ sev ] = on;
+ detail::logger_impl::scoped_lock lock;
+ this->impl_->enabledSeverities_[ sev ] = on;
}
void logger::enableLog(const char* logId, const bool on)
{
- scoped_lock lock;
- instance().enabledLogs_[ std::string(logId ? logId : "") ] = on;
+ detail::logger_impl::scoped_lock lock;
+ instance().impl_->enabledLogs_[ std::string(logId ? logId : "") ] = on;
}
void logger::addListener(log_listener* l)
{
if (!l)
return;
- scoped_lock lock;
- instance().targets_.push_back( l );
+ detail::logger_impl::scoped_lock lock;
+ instance().impl_->targets_.push_back( l );
}
void logger::removeListener(log_listener* l)
{
if (!l)
return;
- scoped_lock lock;
- if (instance().targets_.empty())
+ detail::logger_impl::scoped_lock lock;
+ if (instance().impl_->targets_.empty())
return;
- instance().targets_.erase( std::find(instance().targets_.begin(), instance().targets_.end(), l) );
+ instance().impl_->targets_.erase( std::find(instance().impl_->targets_.begin(), instance().impl_->targets_.end(), l) );
}
void logger::log(const severity_t sev, const char *logId, const char *msg)
{
@@ -115,37 +140,42 @@
}
void logger::doLog(const severity_t sev, const char *logId, const char *msg)
{
- scoped_lock lock;
+ detail::logger_impl::scoped_lock lock;
- EnableMap::const_iterator itEnabled = instance_.enabledSeverities_.find( sev );
- if (itEnabled != instance_.enabledSeverities_.end() && !itEnabled->second)
+ detail::logger_impl::EnableMap::const_iterator itEnabled = instance_.impl_->enabledSeverities_.find( sev );
+ if (itEnabled != instance_.impl_->enabledSeverities_.end() && !itEnabled->second)
return;
- EnableLogIdMap::const_iterator itLogEnabled = instance_.enabledLogs_.find( logId );
- if (itLogEnabled != instance_.enabledLogs_.end() && !itLogEnabled->second)
+ detail::logger_impl::EnableLogIdMap::const_iterator itLogEnabled = instance_.impl_->enabledLogs_.find( logId );
+ if (itLogEnabled != instance_.impl_->enabledLogs_.end() && !itLogEnabled->second)
return;
const threadid_t threadId = native::getCurrentThreadId();
- ListenerList::const_iterator itEnd = targets_.end();
- for (ListenerList::const_iterator it = targets_.begin(); it != itEnd; ++it)
+ detail::logger_impl::ListenerList::const_iterator itEnd = impl_->targets_.end();
+ for (detail::logger_impl::ListenerList::const_iterator it = impl_->targets_.begin(); it != itEnd; ++it)
{
- (*it)->write(sev,msg,logId,procId_.c_str(),threadId);
+ (*it)->write(sev,msg,logId,impl_->procId_.c_str(),threadId);
//(**it)(sev,logId,instance().procId_.c_str(),threadId,msg);
}
}
void logger::setProcessId(const String& pId)
{
- scoped_lock lock;
- instance().procId_ = pId;
+ detail::logger_impl::scoped_lock lock;
+ instance().impl_->procId_ = pId;
}
- logger::logger()
+ logger::logger() : impl_(new detail::logger_impl())
{
- scoped_lock lock;
+ detail::logger_impl::scoped_lock lock;
enableLog(0,true);
for (severity_t i=0; i<S_LAST; ++i)
enableSeverity( i, true );
//addTarget(&toStdErr);
}
+ logger::~logger()
+ {
+ delete impl_;
+ impl_ = 0;
+ }
} // logging
} // yake
Deleted: branches/yake2/yake/src/base/yakeMimeTypeManager.cpp
===================================================================
--- branches/yake2/yake/src/base/yakeMimeTypeManager.cpp 2009-06-24 18:32:09 UTC (rev 1981)
+++ branches/yake2/yake/src/base/yakeMimeTypeManager.cpp 2009-06-24 18:34:06 UTC (rev 1982)
@@ -1,83 +0,0 @@
-/*
- ------------------------------------------------------------------------------------
- This file is part of YAKE
- Copyright (c) 2004 - 2008 The YAKE Team
- For the latest information visit http://www.yake.org
- ------------------------------------------------------------------------------------
- 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 Lesser 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., 59 Temple
- Place - Suite 330, Boston, MA 02111-1307, USA, or go to
- http://www.gnu.org/copyleft/lesser.txt.
- ------------------------------------------------------------------------------------
- If you are interested in another license model contact the Yake Team via
- E-Mail: te...@ya....
- For more information see the LICENSE file in the root directory of the
- source code distribution.
- ------------------------------------------------------------------------------------
-*/
-
-//============================================================================
-// IMPLEMENTATION HEADERS
-//============================================================================
-#include <yake/base/yakePCH.h>
-#include <yake/base/yakeMimeTypeManager.h>
-#include <yake/base/yakeException.h>
-
-//============================================================================
-// INTERFACE STRUCTURES / UTILITY CLASSES
-//============================================================================
-namespace yake
-{
-namespace base
-{
-
-const String MimeTypeManager::UNKNOWN = "unknown";
-
-MimeTypeManager::MimeTypeManager()
-{
-}
-
-void MimeTypeManager::add( const String& rMimeType, const String& rExtension )
-{
- YAKE_DECLARE_FUNCTION( add )
-
- if( mMapping.find( rExtension ) != mMapping.end() )
- YAKE_EXCEPT( "Extension \"" + rExtension + "\" already registered." );
-
- mMapping[ rExtension ] = rMimeType;
-}
-
-
-const String& MimeTypeManager::getMimeTypeForExtension( const String& rExtension ) const
-{
- MappingType::const_iterator iter = mMapping.find( rExtension );
-
- if( iter == mMapping.end() )
- return UNKNOWN;
-
- return ( *iter ).second;
-}
-
-const String& MimeTypeManager::getMimeTypeForFileName( const String& rFilename ) const
-{
- String::size_type pos = rFilename.rfind( '.' );
-
- if( pos == String::npos )
- return UNKNOWN;
-
- String extension = rFilename.substr( pos + 1 );
-
- return getMimeTypeForExtension( extension );
-}
-
-} // base
-} // yake
Modified: branches/yake2/yake/src/base/yakeParamHolder.cpp
===================================================================
--- branches/yake2/yake/src/base/yakeParamHolder.cpp 2009-06-24 18:32:09 UTC (rev 1981)
+++ branches/yake2/yake/src/base/yakeParamHolder.cpp 2009-06-24 18:34:06 UTC (rev 1982)
@@ -26,6 +26,7 @@
*/
#include <yake/base/yakePCH.h>
#include <yake/base/yakeParamHolder.h>
+#include <yake/base/templates/yakeSmartAssert.h>
namespace yake {
@@ -40,7 +41,7 @@
{
return (mParams.end() != mParams.find( id ));
}
- ParamHolder::StringVector ParamHolder::getKeys() const
+ StringVector ParamHolder::getKeys() const
{
StringVector keys;
for (ParamMap::const_iterator it = mParams.begin(); it != mParams.end(); ++it)
Modified: branches/yake2/yake/src/base/yakeStderrLog.cpp
===================================================================
--- branches/yake2/yake/src/base/yakeStderrLog.cpp 2009-06-24 18:32:09 UTC (rev 1981)
+++ branches/yake2/yake/src/base/yakeStderrLog.cpp 2009-06-24 18:34:06 UTC (rev 1982)
@@ -29,6 +29,7 @@
#include <yake/base/yakeStderrLog.h>
#include <yake/base/native/yakeNative.h>
#include <boost/lexical_cast.hpp>
+#include <iostream>
namespace yake {
namespace logging {
Modified: branches/yake2/yake/src/base/yakeString.cpp
===================================================================
--- branches/yake2/yake/src/base/yakeString.cpp 2009-06-24 18:32:09 UTC (rev 1981)
+++ branches/yake2/yake/src/base/yakeString.cpp 2009-06-24 18:34:06 UTC (rev 1982)
@@ -29,6 +29,7 @@
//============================================================================
#include <yake/base/yakePCH.h>
#include <yake/base/yakeString.h>
+#include <algorithm>
//============================================================================
// INTERFACE STRUCTURES / UTILITY CLASSES
Modified: branches/yake2/yake/src/base/yakeUniqueId.cpp
===================================================================
--- branches/yake2/yake/src/base/yakeUniqueId.cpp 2009-06-24 18:32:09 UTC (rev 1981)
+++ branches/yake2/yake/src/base/yakeUniqueId.cpp 2009-06-24 18:34:06 UTC (rev 1982)
@@ -29,6 +29,7 @@
//============================================================================
#include <yake/base/yakePCH.h>
#include <yake/base/yakeUniqueId.h>
+#include <yake/base/templates/yakeSmartAssert.h>
//============================================================================
// INTERFACE STRUCTURES / UTILITY CLASSES
Modified: branches/yake2/yake/yake/base/math/yakeMath.h
===================================================================
--- branches/yake2/yake/yake/base/math/yakeMath.h 2009-06-24 18:32:09 UTC (rev 1981)
+++ branches/yake2/yake/yake/base/math/yakeMath.h 2009-06-24 18:34:06 UTC (rev 1982)
@@ -27,19 +27,12 @@
#ifndef YAKE_BASE_MATH_MATH_H
#define YAKE_BASE_MATH_MATH_H
-//============================================================================
-// IMPLEMENTATION HEADERS
-//============================================================================
-// Standard headers
#ifndef YAKE_BASE_PREREQUISITES_H
# include "yake/base/yakePrerequisites.h"
#endif
-// Yake
#include "yake/base/math/yakeRand.h"
+#include <limits>
-//============================================================================
-// INTERFACE STRUCTURES / UTILITY CLASSES
-//============================================================================
namespace yake {
namespace math {
Modified: branches/yake2/yake/yake/base/math/yakeMersenneTwister.h
===================================================================
--- branches/yake2/yake/yake/base/math/yakeMersenneTwister.h 2009-06-24 18:32:09 UTC (rev 1981)
+++ branches/yake2/yake/yake/base/math/yakeMersenneTwister.h 2009-06-24 18:34:06 UTC (rev 1982)
@@ -95,6 +95,7 @@
#endif
#include <iostream>
#include <math.h>
+#include <ctime>
//============================================================================
// INTERFACE STRUCTURES / UTILITY CLASSES
Modified: branches/yake2/yake/yake/base/math/yakeVector3.h
===================================================================
--- branches/yake2/yake/yake/base/math/yakeVector3.h 2009-06-24 18:32:09 UTC (rev 1981)
+++ branches/yake2/yake/yake/base/math/yakeVector3.h 2009-06-24 18:34:06 UTC (rev 1982)
@@ -27,20 +27,13 @@
#ifndef YAKE_BASE_MATH_VECTOR3_H
#define YAKE_BASE_MATH_VECTOR3_H
-//============================================================================
-// IMPLEMENTATION HEADERS
-//============================================================================
-// Standard headers
#ifndef YAKE_BASE_PREREQUISITES_H
# include "yake/base/yakePrerequisites.h"
#endif
-// Yake
#include "yake/base/math/yakeMath.h"
#include "yake/base/math/yakeQuaternion.h"
+#include <cassert>
-//============================================================================
-// INTERFACE STRUCTURES / UTILITY CLASSES
-//============================================================================
namespace yake {
namespace math {
Modified: branches/yake2/yake/yake/base/math/yakeVolume.h
===================================================================
--- branches/yake2/yake/yake/base/math/yakeVolume.h 2009-06-24 18:32:09 UTC (rev 1981)
+++ branches/yake2/yake/yake/base/math/yakeVolume.h 2009-06-24 18:34:06 UTC (rev 1982)
@@ -28,10 +28,10 @@
#define YAKE_BASE_MATH_VOLUME_H
#include <yake/base/yakePrerequisites.h>
-#include <yake/base/math/yakeMath.h>
#include <yake/base/math/yakeVector3.h>
#include <yake/base/math/yakeGeometry.h>
#include <yake/base/yakeNoncopyable.h>
+#include <set>
namespace yake {
using math::Point3;
Deleted: branches/yake2/yake/yake/base/templates/yakeDeque.h
===================================================================
--- branches/yake2/yake/yake/base/templates/yakeDeque.h 2009-06-24 18:32:09 UTC (rev 1981)
+++ branches/yake2/yake/yake/base/templates/yakeDeque.h 2009-06-24 18:34:06 UTC (rev 1982)
@@ -1,294 +0,0 @@
-/*
- ------------------------------------------------------------------------------------
- This file is part of YAKE
- Copyright (c) 2004 - 2008 The YAKE Team
- For the latest information visit http://www.yake.org
- ------------------------------------------------------------------------------------
- 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 Lesser 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., 59 Temple
- Place - Suite 330, Boston, MA 02111-1307, USA, or go to
- http://www.gnu.org/copyleft/lesser.txt.
- ------------------------------------------------------------------------------------
- If you are interested in another license model contact the Yake Team via
- E-Mail: te...@ya....
- For more information see the LICENSE file in the root directory of the
- source code distribution.
- ------------------------------------------------------------------------------------
-*/
-#ifndef YAKE_BASE_TEMPLATES_DEQUE_H
-#define YAKE_BASE_TEMPLATES_DEQUE_H
-
-//============================================================================
-// IMPLEMENTATION HEADERS
-//============================================================================
-// Standard headers
-#ifndef YAKE_BASEPREREQUISITES_H
-#include "../yakePrerequisites.h"
-#endif
-
-//============================================================================
-// INTERFACE STRUCTURES / UTILITY CLASSES
-//============================================================================
-namespace yake {
-
-template< class _Value, class _Alloc = std::allocator< _Value > >
-class Deque : private std::deque< _Value >
-{
-// Types
-private:
- typedef std::deque< _Value > _MyBase;
-
-public:
- typedef typename _MyBase::value_type value_type;
- typedef typename _MyBase::iterator iterator;
- typedef typename _MyBase::const_iterator const_iterator;
- typedef typename _MyBase::size_type size_type;
- typedef typename _MyBase::difference_type difference_type;
- typedef typename _MyBase::reverse_iterator reverse_iterator;
- typedef typename _MyBase::const_reverse_iterator const_reverse_iterator;
- typedef typename _MyBase::pointer pointer;
- typedef typename _MyBase::const_pointer const_pointer;
-
- typedef typename _Alloc::reference reference;
- typedef typename _Alloc::const_reference const_reference;
-
-// Class
-public:
- explicit Deque( const _Alloc& rAlloc = _Alloc() ) : _MyBase( rAlloc ) {}
-
-// Methods
-public:
- // Iterators
- iterator begin()
- { return _MyBase::begin(); }
-
- const_iterator begin() const
- { return _MyBase::begin(); }
-
- iterator end()
- { return _MyBase::end(); }
-
- const_iterator end() const
- { return _MyBase::end(); }
-
- reverse_iterator rbegin()
- { return _MyBase::rbegin(); }
-
- const_reverse_iterator rbegin() const
- { return _MyBase::rbegin(); }
-
- reverse_iterator rend()
- { return _MyBase::rend(); }
-
- const_reverse_iterator rend() const
- { return _MyBase::rend(); }
-
-
- // Capacity
- size_type size() const
- { return _MyBase::size(); }
-
- size_type max_size()
- { return _MyBase::max_size(); }
-
- bool empty() const
- { return _MyBase::empty(); }
-
-
- // Insert/Delete
- void push_front( const _Value& Value )
- { _MyBase::push_front( Value ); }
-
- void pop_front()
- { _MyBase::pop_front(); }
-
- void push_back( const _Value& Value )
- { _MyBase::push_back( Value ); }
-
- void pop_back()
- { _MyBase::pop_back(); }
-
- iterator insert( iterator Where, const _Value& Value )
- { return _MyBase::insert( Where, Value ); }
-
- void insert( iterator Where, size_type Count, const _Value& Value )
- { _MyBase::insert( Where, Count, Value ); }
-
- iterator erase( iterator pos )
- { return _MyBase::erase( pos ); }
-
- iterator erase(iterator first, iterator last)
- { return _MyBase::erase(first, last); }
-
- void clear()
- { _MyBase::clear(); }
-
- void resize( size_type Newsize )
- { _MyBase::resize( Newsize ); }
-
- void resize( size_type Newsize, _Value Value )
- { _MyBase::resize( Newsize, Value ); }
-
-
- // Assign
- Deque& operator=( const Deque& rDeque )
- {
- Deque( rDeque ).swap( *this );
- return *this;
- }
-
- void assign( size_type Count, const _Value& rValue )
- { _MyBase::assign( Count, rValue ); }
-
- void swap( Deque& rOther )
- {
- using std::swap;
- _MyBase::swap( rOther );
- }
-
-
- // Elements
- reference operator[]( size_type Pos )
- { return _MyBase::operator[]( Pos ); }
-
- const_reference operator[]( size_type Pos ) const
- { return _MyBase::operator[]( Pos ); }
-
- reference at( size_type Pos )
- { return _MyBase::at( Pos ); }
-
- const_reference at( size_type Pos ) const
- { return _MyBase::at( Pos ); }
-
- reference front()
- { return _MyBase::front(); }
-
- const_reference front() const
- { return _MyBase::front(); }
-
- reference back()
- { return _MyBase::back(); }
-
- const_reference back() const
- { return _MyBase::back(); }
-
-
- // Compare
- friend bool operator==( const Deque& lhs, const Deque& rhs )
- {
- const _MyBase& me = lhs;
- return me == rhs;
- }
-
-};
-
- /** The DequeIterator and ConstDequeIterator are based on the templates
- of the same name from OGRE (http://www.ogre3d.org).
- */
-
- template < class T >
- class DequeIterator
- {
- private:
- typename T::iterator mCurrent;
- typename T::iterator mEnd;
- DequeIterator() {}
- public:
- DequeIterator(typename T::iterator start, typename T::iterator end) :
- mCurrent( start ), mEnd( end )
- {
- }
- DequeIterator(T& container) :
- mCurrent( container.begin() ), mEnd( container.end() )
- {
- }
- bool hasMoreElements()
- {
- return mCurrent != mEnd;
- }
- /** Returns the next element in the collection, and advances to the next. */
- typename T::value_type getNext(void)
- {
- return *mCurrent++;
- }
- /** Returns the next element in the collection, without advancing to the next. */
- typename T::value_type peekNext(void)
- {
- return *mCurrent;
- }
- /** Returns a pointer to the next element in the collection, without advancing to the next afterwards. */
- typename T::pointer peekNextPtr(void)
- {
- return &(*mCurrent);
- }
- /** Moves the iterator on one element. */
- void moveNext(void)
- {
- mCurrent++;
- }
- };
- template < class T >
- class ConstDequeIterator
- {
- private:
- typename T::const_iterator mCurrent;
- typename T::const_iterator mEnd;
- ConstDequeIterator() {}
- public:
- ConstDequeIterator( const ConstDequeIterator& other )
- {
- mCurrent = other.mCurrent;
- mEnd = other.mEnd;
- }
- ConstDequeIterator(typename T::const_iterator start, typename T::const_iterator end) :
- mCurrent( start ), mEnd( end )
- {
- }
- ConstDequeIterator(const T& container) :
- mCurrent( container.begin() ), mEnd( container.end() )
- {
- }
- void reset(const T& container)
- {
- mCurrent = container.begin();
- mEnd = container.end();
- }
- bool hasMoreElements()
- {
- return mCurrent != mEnd;
- }
- /** Returns the next element in the collection, and advances to the next. */
- typename T::value_type getNext(void)
- {
- return *mCurrent++;
- }
- /** Returns the next element in the collection, without advancing to the next. */
- typename T::value_type peekNext(void)
- {
- return *mCurrent;
- }
- /** Returns a pointer to the next element in the collection, without advancing to the next afterwards. */
- typename T::const_pointer peekNextPtr(void)
- {
- return &(*mCurrent);
- }
- /** Moves the iterator on one element. */
- void moveNext(void)
- {
- mCurrent++;
- }
- };
-
-
-} // templates
-
-#endif // YAKE_BASE_TEMPLATES_DEQUE_H
Deleted: branches/yake2/yake/yake/base/templates/yakeFastMap.h
===================================================================
--- branches/yake2/yake/yake/base/templates/yakeFastMap.h 2009-06-24 18:32:09 UTC (rev 1981)
+++ branches/yake2/yake/yake/base/templates/yakeFastMap.h 2009-06-24 18:34:06 UTC (rev 1982)
@@ -1,352 +0,0 @@
-/*
- ------------------------------------------------------------------------------------
- This file is part of YAKE
- Copyright (c) 2004 - 2008 The YAKE Team
- For the latest information visit http://www.yake.org
- ------------------------------------------------------------------------------------
- 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 Lesser 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., 59 Temple
- Place - Suite 330, Boston, MA 02111-1307, USA, or go to
- http://www.gnu.org/copyleft/lesser.txt.
- ------------------------------------------------------------------------------------
- If you are interested in another license model contact the Yake Team via
- E-Mail: te...@ya....
- For more information see the LICENSE file in the root directory of the
- source code distribution.
- ------------------------------------------------------------------------------------
-*/
-#ifndef YAKE_BASE_TEMPLATESFASTMAP_H
-#define YAKE_BASE_TEMPLATESFASTMAP_H
-
-//============================================================================
-// IMPLEMENTATION HEADERS
-//============================================================================
-// Standard headers
-#ifndef YAKE_BASEPREREQUISITES_H
-# include "../yakePrerequisites.h"
-#endif
-
-//============================================================================
-// INTERFACE STRUCTURES / UTILITY CLASSES
-//============================================================================
-namespace yake {
-
-////////////////////////////////////////////////////////////////////////////////
-// class template AssocVectorCompare
-// Used by AssocVector
-////////////////////////////////////////////////////////////////////////////////
-
- namespace Private
- {
- template <class Value, class C>
- class AssocVectorCompare : public C
- {
- typedef std::pair<typename C::first_argument_type, Value>
- Data;
- typedef typename C::first_argument_type first_argument_type;
-
- public:
- AssocVectorCompare()
- {}
-
- AssocVectorCompare(const C& src) : C(src)
- {}
-
- bool operator()(const first_argument_type& lhs,
- const first_argument_type& rhs) const
- { return C::operator()(lhs, rhs); }
-
- bool operator()(const Data& lhs, const Data& rhs) const
- { return operator()(lhs.first, rhs.first); }
-
- bool operator()(const Data& lhs,
- const first_argument_type& rhs) const
- { return operator()(lhs.first, rhs); }
-
- bool operator()(const first_argument_type& lhs,
- const Data& rhs) const
- { return operator()(lhs, rhs.first); }
- };
- }
-
-////////////////////////////////////////////////////////////////////////////////
-// class template AssocVector
-// An associative vector built as a syntactic drop-in replacement for std::map
-// BEWARE: AssocVector doesn't respect all map's guarantees, the most important
-// being:
-// * iterators are invalidated by insert and erase operations
-// * the complexity of insert/erase is O(N) not O(log N)
-// * value_type is std::pair<K, V> not std::pair<const K, V>
-// * iterators are random
-////////////////////////////////////////////////////////////////////////////////
-
- template
- <
- class K,
- class V,
- class C = std::less<K>,
- class A = std::allocator< std::pair<K, V> >
- >
- class AssocVector
- : private std::vector< std::pair<K, V>, A >
- , private Private::AssocVectorCompare<V, C>
- {
- typedef std::vector<std::pair<K, V>, A> Base;
- typedef Private::AssocVectorCompare<V, C> MyCompare;
-
- public:
- typedef K key_type;
- typedef V mapped_type;
- typedef typename Base::value_type value_type;
-
- typedef C key_compare;
- typedef A allocator_type;
- typedef typename A::reference reference;
- typedef typename A::const_reference const_reference;
- typedef typename Base::iterator iterator;
- typedef typename Base::const_iterator const_iterator;
- typedef typename Base::size_type size_type;
- typedef typename Base::difference_type difference_type;
- typedef typename A::pointer pointer;
- typedef typename A::const_pointer const_pointer;
- typedef typename Base::reverse_iterator reverse_iterator;
- typedef typename Base::const_reverse_iterator const_reverse_iterator;
-
- class value_compare
- : public std::binary_function<value_type, value_type, bool>
- , private key_compare
- {
- friend class AssocVector;
-
- protected:
- value_compare(key_compare pred) : key_compare(pred)
- {}
-
- public:
- bool operator()(const value_type& lhs, const value_type& rhs) const
- { return key_compare::operator()(lhs.first, rhs.first); }
- };
-
- // 23.3.1.1 construct/copy/destroy
-
- explicit AssocVector(const key_compare& comp = key_compare(),
- const A& alloc = A())
- : Base(alloc), MyCompare(comp)
- {}
-
- template <class InputIterator>
- AssocVector(InputIterator first, InputIterator last,
- const key_compare& comp = key_compare(),
- const A& alloc = A())
- : Base(first, last, alloc), MyCompare(comp)
- {
- MyCompare& me = *this;
- std::sort(begin(), end(), me);
- }
-
- AssocVector& operator=(const AssocVector& rhs)
- {
- AssocVector(rhs).swap(*this);
- return *this;
- }
-
- // iterators:
- // The following are here because MWCW gets 'using' wrong
- iterator begin() { return Base::begin(); }
- const_iterator begin() const { return Base::begin(); }
- iterator end() { return Base::end(); }
- const_iterator end() const { return Base::end(); }
- reverse_iterator rbegin() { return Base::rbegin(); }
- const_reverse_iterator rbegin() const { return Base::rbegin(); }
- reverse_iterator rend() { return Base::rend(); }
- const_reverse_iterator rend() const { return Base::rend(); }
-
- // capacity:
- bool empty() const { return Base::empty(); }
- size_type size() const { return Base::size(); }
- size_type max_size() { return Base::max_size(); }
-
- // 23.3.1.2 element access:
- mapped_type& operator[](const key_type& key)
- { return insert(value_type(key, mapped_type())).first->second; }
-
- // modifiers:
- std::pair<iterator, bool> insert(const value_type& val)
- {
- bool found(true);
- iterator i(lower_bound(val.first));
-
- if (i == end() || this->operator()(val.first, i->first))
- {
- i = Base::insert(i, val);
- found = false;
- }
- return std::make_pair(i, !found);
- }
-
- iterator insert(iterator pos, const value_type& val)
- {
- if (pos != end() && this->operator()(*pos, val) &&
- (pos == end() - 1 ||
- !this->operator()(val, pos[1]) &&
- this->operator()(pos[1], val)))
- {
- return Base::insert(pos, val);
- }
- return insert(val).first;
- }
-
- template <class InputIterator>
- void insert(InputIterator first, InputIterator last)
- { for (; first != last; ++first) insert(*first); }
-
- void erase(iterator pos)
- { Base::erase(pos); }
-
- size_type erase(const key_type& k)
- {
- iterator i(find(k));
- if (i == end()) return 0;
- erase(i);
- return 1;
- }
-
- void erase(iterator first, iterator last)
- { Base::erase(first, last); }
-
- void swap(AssocVector& other)
- {
- using std::swap;
- Base::swap(other);
- MyCompare& me = *this;
- MyCompare& rhs = other;
- swap(me, rhs);
- }
-
- void clear()
- { Base::clear(); }
-
- // observers:
- key_compare key_comp() const
- { return *this; }
-
- value_compare value_comp() const
- {
- const key_compare& comp = *this;
- return value_compare(comp);
- }
-
- // 23.3.1.3 map operations:
- iterator find(const key_type& k)
- {
- iterator i(lower_bound(k));
- if (i != end() && this->operator()(k, i->first))
- {
- i = end();
- }
- return i;
- }
-
- const_iterator find(const key_type& k) const
- {
- const_iterator i(lower_bound(k));
- if (i != end() && this->operator()(k, i->first))
- {
- i = end();
- }
- return i;
- }
-
- size_type count(const key_type& k) const
- { return find(k) != end(); }
-
- iterator lower_bound(const key_type& k)
- {
- MyCompare& me = *this;
- return std::lower_bound(begin(), end(), k, me);
- }
-
- const_iterator lower_bound(const key_type& k) const
- {
- const MyCompare& me = *this;
- return std::lower_bound(begin(), end(), k, me);
- }
-
- iterator upper_bound(const key_type& k)
- {
- MyCompare& me = *this;
- return std::upper_bound(begin(), end(), k, me);
- }
-
- const_iterator upper_bound(const key_type& k) const
- {
- const MyCompare& me = *this;
- return std::upper_bound(begin(), end(), k, me);
- }
-
- std::pair<iterator, iterator> equal_range(const key_type& k)
- {
- MyCompare& me = *this;
- return std::equal_range(begin(), end(), k, me);
- }
-
- std::pair<const_iterator, const_iterator> equal_range(
- const key_type& k) const
- {
- const MyCompare& me = *this;
- return std::equal_range(begin(), end(), k, me);
- }
-
- friend bool operator==(const AssocVector& lhs, const AssocVector& rhs)
- {
- const Base& me = lhs;
- return me == rhs;
- }
-
- bool operator<(const AssocVector& rhs) const
- {
- const Base& me = *this;
- const Base& yo = rhs;
- return me < yo;
- }
-
- friend bool operator!=(const AssocVector& lhs, const AssocVector& rhs)
- { return !(lhs == rhs); }
-
- friend bool operator>(const AssocVector& lhs, const AssocVector& rhs)
- { return rhs < lhs; }
-
- friend bool operator>=(const AssocVector& lhs, const AssocVector& rhs)
- { return !(lhs < rhs); }
-
- friend bool operator<=(const AssocVector& lhs, const AssocVector& rhs)
- { return !(rhs < lhs); }
-
- const_reference at(size_type _Pos) const
- { // subscript nonmutable sequence with checking
- return Base::at(_Pos);
- }
- reference at(size_type _Pos)
- {
- return Base::at(_Pos);
- }
-
- };
-
- // specialized algorithms:
- template <class K, class V, class C, class A>
- void swap(AssocVector<K, V, C, A>& lhs, AssocVector<K, V, C, A>& rhs)
- { lhs.swap(rhs); }
-
-} // yake
-
-#endif // YAKE_BASE_TEMPLATESFASTMAP_H
Modified: branches/yake2/yake/yake/base/templates/yakeManager.h
===================================================================
--- branches/yake2/yake/yake/base/templates/yakeManager.h 2009-06-24 18:32:09 UTC (rev 1981)
+++ branches/yake2/yake/yake/base/templates/yakeManager.h 2009-06-24 18:34:06 UTC (rev 1982)
@@ -35,17 +35,14 @@
# include "../yakePrerequisites.h"
#endif
// Yake
-#include <yake/base/templates/yakeFastMap.h>
#include <yake/base/mpl/null_type.h>
#include <yake/base/yakeException.h>
//============================================================================
// INTERFACE STRUCTURES / UTILITY CLASSES
//============================================================================
-namespace yake
-{
-namespace templates
-{
+namespace yake {
+namespace templates {
// todo cleanup
// this is too complex
Modified: branches/yake2/yake/yake/base/templates/yakeSignals.h
===================================================================
--- branches/yake2/yake/yake/base/templates/yakeSignals.h 2009-06-24 18:32:09 UTC (rev 1981)
+++ branches/yake2/yake/yake/base/templates/yakeSignals.h 2009-06-24 18:34:06 UTC (rev 1982)
@@ -34,6 +34,7 @@
#ifndef YAKE_BASEPREREQUISITES_H
# include <yake/base/yakePrerequisites.h>
#endif
+#include <deque>
#if defined( YAKE_SIGNALS_USE_BOOST )
# include "boost/signal.hpp"
Modified: branches/yake2/yake/yake/base/templates/yakeSingleton.h
===================================================================
--- branches/yake2/yake/yake/base/templates/yakeSingleton.h 2009-06-24 18:32:09 UTC (rev 1981)
+++ branches/yake2/yake/yake/base/templates/yakeSingleton.h 2009-06-24 18:34:06 UTC (rev 1982)
@@ -36,6 +36,7 @@
#endif
// Yake
#include <yake/base/templates/yakeThreads.h>
+#include <cassert>
//============================================================================
// INTERFACE STRUCTURES / UTILITY CLASSES
@@ -281,7 +282,6 @@
>
class SingletonHolder
{
- YAKE_DECLARE_CLASS(yake::templates::SingletonHolder)
public:
static T& instance();
Modified: branches/yake2/yake/yake/base/templates/yakeSmartAssert.h
===================================================================
--- branches/yake2/yake/yake/base/templates/yakeSmartAssert.h 2009-06-24 18:32:09 UTC (rev 1981)
+++ branches/yake2/yake/yake/base/templates/yakeSmartAssert.h 2009-06-24 18:34:06 UTC (rev 1982)
@@ -32,6 +32,7 @@
//============================================================================
#include <yake/base/yakePrerequisites.h>
#include <yake/base/yakeString.h>
+#include <map>
//============================================================================
// INTERFACE STRUCTURES / UTILITY CLASSES
@@ -66,7 +67,7 @@
String mFile;
int32 mLine;
String mExpr;
- typedef AssocVector< String, String > ValueMapT;
+ typedef std::map< String, String > ValueMapT;
ValueMapT mValueMap;
std::vector< String > mMsgs;
AssertionLevel mLevel;
Modified: branches/yake2/yake/yake/base/yake.h
===================================================================
--- branches/yake2/yake/yake/base/yake.h 2009-06-24 18:32:09 UTC (rev 1981)
+++ branches/yake2/yake/yake/base/yake.h 2009-06-24 18:34:06 UTC (rev 1982)
@@ -40,7 +40,6 @@
#include "templates/yakeRegistry.h"
#include "templates/yakeVector.h"
#include "templates/yakePointer.h"
-#include <yake/base/templates/yakeDeque.h>
#include <yake/base/templates/delete.h>
#include <yake/base/templates/yakeVariant.h>
#include "templates/yakeAlgorithms.h"
Modified: branches/yake2/yake/yake/base/yakeDataChunk.h
===================================================================
--- branches/yake2/yake/yake/base/yakeDataChunk.h 2009-06-24 18:32:09 UTC (rev 1981)
+++ branches/yake2/yake/yake/base/yakeDataChunk.h 2009-06-24 18:34:06 UTC (rev 1982)
@@ -45,7 +45,6 @@
*/
class YAKE_BASE_API DataChunk
{
-YAKE_DECLARE_CLASS( yake::base::DataChunk )
// Class
protected:
DataChunk( const DataChunk& );
Modified: branches/yake2/yake/yake/base/yakeLog.h
===================================================================
--- branches/yake2/yake/yake/base/yakeLog.h 2009-06-24 18:32:09 UTC (rev 1981)
+++ branches/yake2/yake/yake/base/yakeLog.h 2009-06-24 18:34:06 UTC (rev 1982)
@@ -32,12 +32,8 @@
#endif
#include <yake/base/yakeNoncopyable.h>
#include <yake/base/yakeString.h>
-#include <yake/base/templates/yakeSingleton.h>
#include <yake/base/templates/yakePointer.h>
-
#include <yake/base/native/yakeThreads.h>
-#include <boost/thread/mutex.hpp>
-#include <boost/thread/recursive_mutex.hpp>
namespace yake {
namespace logging {
@@ -62,19 +58,25 @@
YAKE_BASE_API void formatLogMessage(std::ostream&, const severity_t sev, const char* msg, const char* logId, const char* procId, threadid_t threadId);
/** */
- struct YAKE_BASE_API log_listener : public boost::noncopyable
+ struct YAKE_BASE_API log_listener : public noncopyable
{
virtual ~log_listener();
virtual void write(const severity_t sev, const char* msg, const char* logId, const char* procId, threadid_t threadId) = 0;
};
typedef SharedPtr<log_listener> log_listener_ptr;
+ namespace detail {
+ struct logger_impl;
+ } // detail
+
/** */
- struct YAKE_BASE_API logger : public boost::noncopyable
+ struct YAKE_BASE_API logger : public noncopyable
{
+ friend struct detail::logger_impl;
//YAKE_BUILD_PHOENIX_SINGLETON(logger) //public
private: //Make it private if PHOENIX is not used!
logger();
+ ~logger();
static logger instance_;
public:
static logger& instance();
@@ -92,22 +94,7 @@
//void doLog(const severity_t, const char* env, const char* msg);
void doLog(const severity_t, const char* logId, const char* msg);
private:
- String procId_;
- typedef std::vector<log_listener*> ListenerList;
- ListenerList targets_;
- typedef std::map<severity_t,bool> EnableMap;
- EnableMap enabledSeverities_;
- typedef std::map<std::string,bool> EnableLogIdMap;
- EnableLogIdMap enabledLogs_;
- boost::recursive_mutex mtx_;
- struct scoped_lock;
- friend struct scoped_lock;
- struct scoped_lock : public boost::noncopyable
- {
- scoped_lock();
- private:
- boost::recursive_mutex::scoped_lock lck_;
- };
+ detail::logger_impl* impl_;
};
////////////////
Deleted: branches/yake2/yake/yake/base/yakeMimeTypeManager.h
===================================================================
--- branches/yake2/yake/yake/base/yakeMimeTypeManager.h 2009-06-24 18:32:09 UTC (rev 1981)
+++ branches/yake2/yake/yake/base/yakeMimeTypeManager.h 2009-06-24 18:34:06 UTC (rev 1982)
@@ -1,80 +0,0 @@
-/*
- ------------------------------------------------------------------------------------
- This file is part of YAKE
- Copyright (c) 2004 - 2008 The YAKE Team
- For the latest information visit http://www.yake.org
- ------------------------------------------------------------------------------------
- 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 Lesser 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., 59 Temple
- Place - Suite 330, Boston, MA 02111-1307, USA, or go to
- http://www.gnu.org/copyleft/lesser.txt.
- ------------------------------------------------------------------------------------
- If you are interested in another license model contact the Yake Team via
- E-Mail: te...@ya....
- For more information see the LICENSE file in the root directory of the
- source code distribution.
- ------------------------------------------------------------------------------------
-*/
-#ifndef YAKE_BASE_MIMETYPEMANAGER_H
-#define YAKE_BASE_MIMETYPEMANAGER_H
-
-//============================================================================
-// IMPLEMENTATION HEADERS
-//============================================================================
-// Standard headers
-#ifndef YAKE_BASE_PREREQUISITES_H
-# include <yake/base/yakePrerequisites.h>
-#endif
-// Yake
-#include <yake/base/templates/yakeSingleton.h>
-#include <yake/base/yakeString.h>
-
-//============================================================================
-// INTERFACE STRUCTURES / UTILITY CLASSES
-//============================================================================
-namespace yake
-{
-namespace base
-{
-
-class YAKE_BASE_API MimeTypeManager
-{
-YAKE_DECLARE_CLASS( yake::base::MimeTypeManager )
-// Types
-private:
- typedef std::map< String, String > MappingType;
-
-// Class
-public:
- MimeTypeManager();
-
-// Methods
-public:
- void add( const String& rMimeType, const String& rExtension );
-
- const String& getMimeTypeForExtension( const String& rExtension ) const;
- const String& getMimeTypeForFileName( const String& rFilename ) const;
-
-// Data
-public:
- static const String UNKNOWN;
-
-private:
- MappingType mMapping;
-
-YAKE_BUILD_SINGLETON( MimeTypeManager )
-};
-
-} // base
-} // yake
-
-#endif // YAKE_BASE_MIMETYPEMANAGER_H
Modified: branches/yake2/yake/yake/base/yakePCH.h
===================================================================
--- branches/yake2/yake/yake/base/yakePCH.h 2009-06-24 18:32:09 UTC (rev 1981)
+++ branches/yake2/yake/yake/base/yakePCH.h 2009-06-24 18:34:06 UTC (rev 1982)
@@ -28,6 +28,5 @@
#define YAKE_BASE_PCH_H
#include <yake/base/yakePrerequisites.h>
-#include <yake/base/templates/yakeSmartAssert.h>
#endif // YAKE_BASE_PCH_H
Modified: branches/yake2/yake/yake/base/yakeParamHolder.h
===================================================================
--- branches/yake2/yake/yake/base/yakeParamHolder.h 2009-06-24 18:32:09 UTC (rev 1981)
+++ branches/yake2/yake/yake/base/yakeParamHolder.h 2009-06-24 18:34:06 UTC (rev 1982)
@@ -28,8 +28,8 @@
#define YAKE_BASE_PARAMHOLDER_H
#include <yake/base/yakePrerequisites.h>
-#include <yake/base/templates/yakeVector.h>
#include <yake/base/yakeString.h>
+#include <map>
#include <boost/any.hpp>
#include <boost/optional.hpp>
@@ -47,9 +47,6 @@
/** Parameter value */
typedef boost::any Value;
- /** A vector of strings */
- typedef Vector<String> StringVector;
-
/** Returns all keys stored in the parameter holder object. */
StringVector getKeys() const;
@@ -79,7 +76,7 @@
bool has( const String & id ) const;
private:
- typedef AssocVector< String, Value > ParamMap;
+ typedef std::map< String, Value > ParamMap;
ParamMap mParams;
Value mParamNone;
};
Modified: branches/yake2/yake/yake/base/yakePrerequisites.h
===================================================================
--- branches/yake2/yake/yake/base/yakePrerequisites.h 2009-06-24 18:32:09 UTC (rev 1981)
+++ branches/yake2/yake/yake/base/yakePrerequisites.h 2009-06-24 18:34:06 UTC (rev 1982)
@@ -39,19 +39,7 @@
# define NOMINMAX
#endif
-#include <assert.h>
-#include <ctime>
-#include <math.h>
-#include <cmath>
-#include <limits>
#include <string>
-#include <stdexcept>
-#include <algorithm>
-#include <vector>
-#include <map>
-#include <list>
-#include <queue>
-#include <set>
#ifdef __SGI_STL
# include <iterator>
@@ -144,14 +132,9 @@
#define YAKE_SAFE_DELETE(ptr) if(ptr) { delete ptr; ptr = 0; }
#define YAKE_SAFE_DELETE_ARRAY(ptr_array) if(ptr_array) { delete [] ptr_array; ptr_array = 0; }
-#define YAKE_DECLARE_CLASS(name) static const char * yake_private_currentClass() { return #name; }
-#define YAKE_DECLARE_GLOBAL YAKE_DECLARE_CLASS( global )
-#define YAKE_DECLARE_FUNCTION(name) static const char * yake_private_currentFunction = #name "()";
-
#define YAKE_FOR_EACH(ITER_TYPE,ITER_NAME,CTR) \
for (ITER_TYPE ITER_NAME = CTR.begin(); ITER_NAME != CTR.end(); ++ITER_NAME)
-
#ifdef YAKE_DEBUG
# define YAKE_DYNLIB_POSTFIX "_d"
#else
Modified: branches/yake2/yake/yake/base/yakeString.h
===================================================================
--- branches/yake2/yake/yake/base/yakeString.h 2009-06-24 18:32:09 UTC (rev 1981)
+++ branches/yake2/yake/yake/base/yakeString.h 2009-06-24 18:34:06 UTC (rev 1982)
@@ -32,8 +32,6 @@
//============================================================================
// Standard headers
#include <yake/base/yakePrerequisites.h>
-#include <yake/base/templates/yakeVector.h>
-#include <yake/base/templates/yakeFastMap.h>
#include <sstream>
//============================================================================
@@ -61,7 +59,7 @@
return lhs + ss.str();
}
- typedef Vector<String> StringVector;
+ typedef std::vector<String> StringVector;
class YAKE_BASE_API StringUtil
{
@@ -119,7 +117,7 @@
StringVector m_strings;
};
typedef std::pair<String,String> StringPair;
- typedef Vector<StringPair> StringPairVector;
+ typedef std::vector<StringPair> StringPairVector;
struct YAKE_BASE_API MakeStringPairVector
{
MakeStringPairVector & operator<<(const StringPair& stringPair)
@@ -135,32 +133,6 @@
StringPairVector m_stringPairs;
};
- typedef AssocVector<String,String> StringMap;
- struct YAKE_BASE_API MakeStringMap
- {
- MakeStringMap & operator<<(const StringPair& stringPair)
- {
- m_map.insert( stringPair );
- return *this;
- }
- operator StringMap()
- {
- return m_map;
- }
- private:
- StringMap m_map;
- };
- inline std::ostream& operator << (std::ostream& out, const StringMap& rhs)
- {
- out << "StringMap(";
- for (StringMap::const_iterator it = rhs.begin(); it != rhs.end(); ++it)
- {
- out << ((it == rhs.begin()) ? "" : ";")
- << it->first << "=" << it->second;
- }
- out << ")";
- return out;
- }
#undef YAKE_BASE_STRING
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <psy...@us...> - 2009-06-24 18:32:17
|
Revision: 1981
http://yake.svn.sourceforge.net/yake/?rev=1981&view=rev
Author: psyclonist
Date: 2009-06-24 18:32:09 +0000 (Wed, 24 Jun 2009)
Log Message:
-----------
added premake4 build scripts
Added Paths:
-----------
branches/yake2/yake/BUILDING
branches/yake2/yake/premake4.lua
Removed Paths:
-------------
branches/yake2/yake/BUILD
Deleted: branches/yake2/yake/BUILD
===================================================================
--- branches/yake2/yake/BUILD 2009-06-22 16:02:15 UTC (rev 1980)
+++ branches/yake2/yake/BUILD 2009-06-24 18:32:09 UTC (rev 1981)
@@ -1,240 +0,0 @@
-
-This file is part of Yake. Copyright (c) by the Yake Team and the contributors.
-
-This document contains build instructions for different platforms:
-
-CONTENTS
---------
-
-0. Prologue
-1. BUILD INSTRUCTIONS FOR YAKE ON PC/WINDOWS
-1.1 Configuration
-1.2 Building with Microsoft Visual C++ 2003/2005/2008 (7.1/8.0/9.0)
-1.3 Building with Code::Blocks
-1.4 Building with GCC
-2 BUILD INSTRUCTIONS FOR YAKE ON PC/LINUX
-2.1 Building Yake with premake
-2.2 Building Yake with SCons
-3 BUILD INSTRUCTIONS FOR CUSTOM PROJECTS
-4 LIBRARY NAMING SCHEME
-
-0. Prologue
------------
-
-The YAKE Documentation and User Wiki may contain more detailed instructions or
-additional information.
-
-You can find it here: http://www.yake.org/wiki/ .
-
-The manual can be found here: http://www.yake.org/docs/manual/multi/ .
-The sources to the manual can be found in this source release
-in the 'documentation/manual' subdirectory.
-
-For help visit the Forums: http://www.yake.org/forum/ .
-
-For reporting/tracking bugs visit http://bugs.yake.org/ .
-
-
-1. BUILD INSTRUCTIONS FOR YAKE ON PC/WINDOWS
---------------------------------------------
-
-Last modified: 12 Dec 2008 by Stephan Kaiser (psy)
-
-1.1.0 Sources
-----------------------------------------------------------
-
-Download a source package or checkout the sources from the repository.
-Detailed information on available sources can be found at www.yake.org.
-
-This article assumes that the root directory is 'yake' and the directory
-structure looks like this:
- yake/
- src/
- yake/
- scripts/
-etc.
-
-1.1.1 Directory structure
-----------------------------------------------------------
-
- yake/yake - includes for components (in each subdirectory)
- yake/src - implementation for components (in respective subdirectories)
- yake/common/bin - target directory for dynamic link libraries
- yake/common/lib - target directory for .lib/.a (static and dll)
- yake/samples - sources to demo applications
- yake/samples/bin - target directory for sample executables
- yake/scripts/premake - main build script generation files/scripts
- yake/scripts/linux - build script generation for Linux platforms
- yake/scripts/msvc71 - build script generation for Windows/MSVC7.1 platform
- yake/scripts/msvc80 - build script generation for Windows/MSVC8.0 platform
- yake/scripts/msvc90 - build script generation for Windows/MSVC9.0 platform
- yake/scripts/cb_gnu_win - build script generation for Windows/CodeBlocks platform
- yake/common/media - common media as used by the demo applications
- yake/dependencies - directory containing 3rd party libraries (ogre, ode, ...)
-
-1.1.3 Requirements
-----------------------------------------------------------
-
- * a recent C++ compiler (MSVC7.1/8.0/9.0+ or GCC 3.3/3.4/4.x+)
- * a good standard template library (STL)
- * boost 1.36.x or above (not all libraries are needed)
-
-1.1.4 Dependencies
-----------------------------------------------------------
-
-For specific components additional dependencies are required.
-These include:
- * ODE 0.6/0.7 for physicsODE
- * OGRE 1.4.x+ for graphicsOGRE
- * Lua 5.x for scriptingLua, entLua etc
- * Luabind (.7+1, i.e. SVN) for scriptingLua, entLua etc
- * CEGUI 0.5.x
- * OpenAL 1.1 SDK for audioAL
- * OpenAL++
- * TinyXML
- * ...
-
-We provide PREBUILT DEPENDENCIES packages for certain platform/compiler
-combinations.
-
-If there is a dependencies package for your platform/compiler then
-simply extract the archive over the root source directory of Yake.
-
-Otherwise you will have to manually install premake, the generator
-for Visual C++ projects (.vcproj/.sln), and build the dependencies
-yourself.
-
-Installation of premake:
-* Obtain premake from http://premake.sourceforge.net
-* Install premake and put the premake.exe into /yake/scripts/premake.
-* Change to /yake/scripts/premake
-* Configure config.lua etc. to meet your requirements
-
-1.1.5 Configuration
-----------------------------------------------------------
-
-If you need to configure the build process you find the available
-options in /yake/scripts/premake/config.lua.
-
-1.2 Building with Microsoft Visual C++ 2003/2005/2008 (7.1/8.0/9.0)
-----------------------------------------------------------
-
-To build the libraries:
-* Run build.cmd in /yake/scripts/msvc71/ or /yake/scripts/msvc80/
- or /yake/scripts/msvc90/ in order to build solutions for MSVC 2003
- or MSVC 2005 or MSVC 2008.
-* Solution and project files can then be found in the same directory.
-* Open yake.sln in MSVC and start 'Build All'
-* Find the libs in /yake/common/lib and the DLLs in /yake/common/bin
-
-To build the samples:
-* Run build_samples.cmd in /yake/scripts/msvc71/ or /yake/scripts/msvc80/
- or /yake/scripts/msvc90/.
-* Open yake_samples.sln and start 'Build All'
-* Find the executables in /yake/samples/bin
-
-For stable releases of Yake prebuilt dependencies packages are available.
-
-If you don't have or don't want to use the dependencies package
-then you have to compile the dependencies yourself as needed, of course.
-
-See the file /yake/dependencies/DEPENDENCIES for more information.
-
-1.3 Building with Code::Blocks
-------------------------------
-
-The Code Blocks project files can be found in this directory:
-
-* Run build_cb.cmd
-* Open resulting cb solution and build it from the IDE
-
-1.4 Building with GCC
----------------------
-
- >> Instructions to come <<
-
-
-
-2. BUILD INSTRUCTIONS FOR YAKE ON PC/LINUX
-------------------------------------------
-
-2.1 Building Yake with premake
-------------------------------------------
-
-* Choose a distribution
-
-* Install premake
-
- Note: The build script generation below expects the 'premake' executable
- to be available in the path.
-
-* Set up the dependency directory (see 2.2 below)
-
-* Build Yake's libraries including plugins:
-
- * Open a console and move to the Yake root directory
-
- # cd scripts/linux
- # ./build.sh
- # make
-
-
- * Build Yake demos:
-
- * Open a console and move to the Yake root directory
-
- # cd scripts/linux
- # ./build_samples.sh
- # make
-
- >> More instructions to come <<
-
-2.2 Building Yake with SCons
-------------------------------------------
-
-Last modified: 12/3/2008 by Stephan Kaiser (psy)
-Last modified: 30/9/2005 by Stephan Kaiser (psy)
-Last modified: 22/9/2004 by Nikita Buida (mj)
-
-Support for SCons build system has been DEPRECATED.
-
-If you still want to use it, please visit www.yake.org and search the forums
-and the wiki. You may find the solution there.
-
-3 BUILD INSTRUCTIONS FOR CUSTOM PROJECTS
-----------------------------------------
-
-For using Yake in your project do the following:
-
- Add /yake/yake to the include paths.
- Add /yake/common/lib to the library search paths.
-
-If the auto-link feature is not available (notably, GCC) add the proper linker
-dependencies for each library/component you use (e.g. yake_ent_d.lib
-for the yake_ent_d.dll on Windows).
-
-4 LIBRARY NAMING SCHEME
------------------------
-
- Library file endings vary depending on platform and compiler settings.
- On PC/Windows with Microsoft Visual C++ the endings are ".lib" and ".dll".
- On PC/Windows with Code::Blocks and GCC the endings are ".a" and ".dll".
- On PC/Linux with GCC the endings are ".a" and ".so".
-
- The general naming scheme is:
-
- yake_[name][[_s][_d]|[_sym]].[[lib|dll]|[a|so]]
-
- _s indicates a static library
- _d indicates a debug build, the absence of _d indicates a release build
- _sym indicates a release dynamic link library with debug symbols
-
- For each library there are 5 build targets (at least, on Windows):
- Release, Debug, ReleaseLib, DebugLib, ReleaseWithSymbols
-
- Release: dynamic link library, e.g. yake_base.* (where * can be .lib/.dll/.a/.so)
- Debug: dynamic link library, e.g. yake_base_d.* (where * can be .lib/.dll/.a/.so)
- ReleaseLib: static library, e.g. yake_base_s.* (where * can be lib/.a)
- DebugLib: static library, e.g. yake_base_s_d.* (where * can be lib/.a)
- ReleaseWithSymbols: dynamic link library, e.g. yake_base_sym.* (where * can be .lib/.dll/.a/.so)
-
Copied: branches/yake2/yake/BUILDING (from rev 1980, branches/yake2/yake/BUILD)
===================================================================
--- branches/yake2/yake/BUILDING (rev 0)
+++ branches/yake2/yake/BUILDING 2009-06-24 18:32:09 UTC (rev 1981)
@@ -0,0 +1,234 @@
+
+This file is part of Yake. Copyright (c) by the Yake Team and the contributors.
+
+This document contains build instructions for different platforms:
+
+CONTENTS
+--------
+
+0. Prologue
+1. BUILD INSTRUCTIONS FOR YAKE ON PC/WINDOWS
+1.1 Configuration
+1.2 Building with Microsoft Visual C++ 2003/2005/2008 (7.1/8.0/9.0)
+1.3 Building with Code::Blocks
+1.4 Building with GCC
+2 BUILD INSTRUCTIONS FOR YAKE ON PC/LINUX
+2.1 Building Yake with premake
+2.2 Building Yake with SCons
+3 BUILD INSTRUCTIONS FOR CUSTOM PROJECTS
+4 LIBRARY NAMING SCHEME
+
+0. Prologue
+-----------
+
+The YAKE Documentation and User Wiki may contain more detailed instructions or
+additional information.
+
+You can find it here: http://www.yake.org/wiki/ .
+
+The manual can be found here: http://www.yake.org/docs/manual/multi/ .
+The sources to the manual can be found in this source release
+in the 'documentation/manual' subdirectory.
+
+For help visit the Forums: http://www.yake.org/forum/ .
+
+For reporting/tracking bugs visit http://bugs.yake.org/ .
+
+
+1. BUILD INSTRUCTIONS FOR YAKE ON PC/WINDOWS
+--------------------------------------------
+
+Last modified: 12 Dec 2008 by Stephan Kaiser (psy)
+
+1.1.0 Sources
+----------------------------------------------------------
+
+Download a source package or checkout the sources from the repository.
+Detailed information on available sources can be found at www.yake.org.
+
+This article assumes that the root directory is 'yake' and the directory
+structure looks like this:
+ yake/
+ src/
+ yake/
+ scripts/
+etc.
+
+1.1.1 Directory structure
+----------------------------------------------------------
+
+ yake/yake - includes for components (in each subdirectory)
+ yake/src - implementation for components (in respective subdirectories)
+ yake/build - directory containing object files and binaries
+ yake/build/stage - target directory for dynamic/static libraries
+ yake/samples - sources to demo applications
+ yake/samples/bin - target directory for sample executables
+ yake/common/media - common media as used by the demo applications
+ yake/dependencies - directory containing 3rd party libraries (ogre, ode, ...)
+
+1.1.3 Requirements
+----------------------------------------------------------
+
+ * a recent C++ compiler (MSVC7.1/8.0/9.0+ or GCC 3.3/3.4/4.x+)
+ * a good standard template library (STL)
+ * boost 1.36.x or above (not all libraries are needed)
+
+1.1.4 Dependencies
+----------------------------------------------------------
+
+For specific components additional dependencies are required.
+These include:
+ * ODE 0.6/0.7 for physicsODE
+ * OGRE 1.4.x+ for graphicsOGRE
+ * Lua 5.x for scriptingLua, entLua etc
+ * Luabind (.7+1, i.e. SVN) for scriptingLua, entLua etc
+ * CEGUI 0.5.x
+ * OpenAL 1.1 SDK for audioAL
+ * OpenAL++
+ * TinyXML
+ * ...
+
+We provide PREBUILT DEPENDENCIES packages for certain platform/compiler
+combinations.
+
+If you don't have or don't want to use the dependencies package
+then you have to compile the dependencies yourself as needed, of course.
+
+See the file /yake/dependencies/DEPENDENCIES for more information.
+
+If there is a dependencies package for your platform/compiler then
+simply extract the archive over the root source directory of Yake.
+
+Otherwise you will have to manually install premake, the generator
+for Visual C++ projects (.vcproj/.sln), and build the dependencies
+yourself.
+
+Installation of premake:
+* Obtain premake from http://premake.sourceforge.net
+* Install premake and put the premake.exe into /yake/scripts/premake.
+* Change to /yake/scripts/premake
+* Configure config.lua etc. to meet your requirements
+
+1.1.5 Configuration
+----------------------------------------------------------
+
+If you need to configure the build process you find the available
+options in /yake/scripts/premake/config.lua.
+
+1.2 Building with Microsoft Visual C++ 2003/2005/2008 (7.1/8.0/9.0)
+----------------------------------------------------------
+
+In the following we use "vs2008" but you can retrieve a list of alternative
+actions by running "premake4 --help".
+
+* Create solution (.sln) and project (.vcproj) files:
+
+ premake4 vs2008
+
+ The .sln and .vcproj files can then be found in "build/vs2008".
+
+* Build all projects (libraries, demos):
+
+ premake4 --toolset=vs2008 make
+
+ Note: Make sure that "make" is the last parameter, i.e. after "--toolset"!
+
+* Alternatively, you open "build/vs2008/yake.sln" in the Visual Studio IDE
+ and use the "Build All" option.
+
+By default, the libraries can now be found in "build/vs2008/bin".
+
+
+1.3 Building with Code::Blocks
+------------------------------
+
+The Code Blocks project files can be found in this directory:
+
+* premake4 codeblocks
+* premake4 --toolset=codeblocks make
+* Open resulting cb solution and build it from the IDE
+
+1.4 Building with GCC
+---------------------
+
+* To create the make file: premake4 gmake
+* To build all projects: make
+
+2. BUILD INSTRUCTIONS FOR YAKE ON PC/LINUX
+------------------------------------------
+
+2.1 Building Yake with premake
+------------------------------------------
+
+* Choose a distribution
+
+* Install premake
+
+ Note: The build script generation below expects the 'premake' executable
+ to be available in the path.
+
+* Set up the dependency directory (see 2.2 below)
+
+* Build Yake's libraries including plugins and demos:
+
+ * Open a console and move to the Yake root directory
+
+ # ./premake4 gmake
+ # make
+
+
+ * To betuild without the demos:
+
+ # ./premake4 --without-demos gmake
+ # make
+
+2.2 Building Yake with SCons
+------------------------------------------
+
+Last modified: 12/3/2008 by Stephan Kaiser (psy)
+Last modified: 30/9/2005 by Stephan Kaiser (psy)
+Last modified: 22/9/2004 by Nikita Buida (mj)
+
+Support for SCons build system has been DISCONTINUED.
+
+If you still want to use it, please visit www.yake.org and search the forums
+and the wiki. You may find the solution there.
+
+3 BUILD INSTRUCTIONS FOR CUSTOM PROJECTS
+----------------------------------------
+
+For using Yake in your project do the following:
+
+ Add /yake/yake to the include paths.
+ Add /yake/build/<toolset>/bin to the library search paths.
+ (Or after 'premake4 --toolset=<toolset> stage' use /yake/build/stage instead.)
+
+If the auto-link feature is not available (notably, GCC) add the proper linker
+dependencies for each library/component you use (e.g. yake_ent_d.lib
+for the yake_ent_d.dll on Windows).
+
+4 LIBRARY NAMING SCHEME
+-----------------------
+
+ Library file endings vary depending on platform and compiler settings.
+ On PC/Windows with Microsoft Visual C++ the endings are ".lib" and ".dll".
+ On PC/Windows with Code::Blocks and GCC the endings are ".a" and ".dll".
+ On PC/Linux with GCC the endings are ".a" and ".so".
+
+ The general naming scheme is:
+
+ yake_[name][_[s][d]|[_sym]].[[lib|dll]|[a|so]]
+
+ s indicates a static library, the absence of s indicates a dynamic library
+ d indicates a debug build, the absence of d indicates a release build
+ _sym indicates a release dynamic link library with debug symbols
+
+ For each library there are 5 build targets (at least, on Windows):
+ ReleaseDLL, DebugDLL, ReleaseLib, DebugLib, ReleaseWithSymbols
+
+ Release: dynamic link library, e.g. yake_base.* (where * can be .lib/.dll/.a/.so)
+ Debug: dynamic link library, e.g. yake_base_d.* (where * can be .lib/.dll/.a/.so)
+ ReleaseLib: static library, e.g. yake_base_s.* (where * can be lib/.a)
+ DebugLib: static library, e.g. yake_base_sd.* (where * can be lib/.a)
+ ReleaseWithSymbols: dynamic link library, e.g. yake_base_sym.* (where * can be .lib/.dll/.a/.so)
+
Added: branches/yake2/yake/premake4.lua
===================================================================
--- branches/yake2/yake/premake4.lua (rev 0)
+++ branches/yake2/yake/premake4.lua 2009-06-24 18:32:09 UTC (rev 1981)
@@ -0,0 +1,354 @@
+
+-- C O N F I G U R A T I O N
+
+--ROOT_DIR = "../../"
+ROOT_DIR = "./"
+DEP_DIR = ROOT_DIR .. "dependencies/"
+
+DEBUG_DLL_SUFFIX = "dll"
+LIBFILE_PREFIX = ""
+YAKE_LUA_BINDINGS = true
+ENABLE_LUA_BASE = true
+
+--
+local yake_deps = {}
+if os.is("windows") then
+ yake_deps["boost"] = {
+ includedirs = { DEP_DIR .. "boost" },
+ libdirs = { DEP_DIR .. "boost/stage/lib" },
+ }
+ yake_deps["lua"] = {
+ includedirs = { DEP_DIR .. "lua" },
+ libdirs = { DEP_DIR .. "lua/lib" },
+ links = {
+ ["Debug"] = { "lua5.1d" },
+ ["DebugLib"] = { "lua5.1d" },
+ ["DebugDLL"] = { "lua5.1d" },
+ ["Release"] = { "lua5.1" },
+ ["ReleaseLib"] = { "lua5.1" },
+ ["ReleaseDLL"] = { "lua5.1" },
+ }
+ }
+end
+local function require_package_incs(name)
+ print("require_package_incs",name)
+ if not name then
+ return true
+ end
+ if type(name) == "table" then
+ for _,k in pairs(name) do
+ require_package_incs(k)
+ end
+ return true
+ end
+ assert( yake_deps[name], "require_package: dependency '"..tostring(name).."' not found")
+ local dep = yake_deps[name]
+ if dep.includedirs then
+ includedirs( dep.includedirs )
+ end
+ return true
+end
+local function require_package_links(cfg,name)
+ assert( cfg, "require_package_links: no config specified" )
+ print("require_package_links",name)
+ if not name then
+ return true
+ end
+ if type(name) == "table" then
+ for _,k in pairs(name) do
+ require_package_links(cfg,k)
+ end
+ return true
+ end
+ assert( yake_deps[name], "require_package: dependency '"..tostring(name).."' not found")
+ local dep = yake_deps[name]
+ if dep.libdirs then
+ libdirs( dep.libdirs )
+ end
+ if dep.links and dep.links[cfg] then
+ links( dep.links[cfg] )
+ end
+ return true
+end
+
+-- options
+newoption {
+ trigger = "without-demos",
+ --value = "VALUE",
+ description = "Select whether make files for the demos will be generated.",
+ --allowed = { {"yes","Generate make files for demos (Default)"}, {"no","Do not generate make files for demos"} }
+}
+print(_OPTIONS["without-demos"])
+--_OPTIONS["without-demos"] = _OPTIONS["without-demos"] or "yes"
+print(_OPTIONS["without-demos"])
+
+newoption {
+ trigger = "toolset",
+ value = "TOOLSET",
+ description = "Choose a toolkit for action 'build'",
+ allowed = {{"vs2008","Visual C++ 2008 (9.0)"},
+ {"vs2005","Visual C++ 2005 (8.0)"}
+ }
+}
+newoption {
+ trigger = "force-symbols",
+ description = "Force the generation of debug symbols information."
+}
+
+newaction {
+ trigger = "make",
+ description = "Builds all projects, libraries and (optionally) demos for the toolset specified with --toolset",
+ execute = function()
+ print("Building... toolset="..tostring(_OPTIONS["toolset"]))
+ if os.is("windows") then
+ assert(_OPTIONS["toolset"],"No toolkit specified! Example: premake4 --toolset=vs2008 make")
+ local start_time = os.clock()
+ os.execute("devenv build\\".._OPTIONS["toolset"].."\\yake.sln /Build DebugDLL")
+ local end_time = os.clock()
+ print("build time: ",tostring(end_time - start_time).." seconds")
+ else
+ print("run make!")
+ end
+ end
+}
+newaction {
+ trigger = "stage",
+ description = "Sets up the staging directory... for the toolset set with --toolset",
+ execute = function()
+ print("Staging... toolset="..tostring(_OPTIONS["toolset"]))
+ assert(_OPTIONS["toolset"],"No toolkit specified! Example: premake4 --toolset=vs2008 make")
+ local dest_path = "build/stage/"
+ if not os.isdir(dest_path) then
+ os.mkdir(dest_path)
+ end
+ --assert( os.isdir(dest_path), "Could not create directory: "..dest_path )
+ local source_path = "build/".._OPTIONS["toolset"].."/bin/"
+
+ local files = os.matchfiles(source_path .. "*.dll")
+ for _,v in pairs(files) do
+ print("Copy",v,dest_path .. path.getname(v))
+ os.copyfile(v,dest_path .. path.getname(v))
+ end
+ files = os.matchfiles(source_path .. "*.lib")
+ for _,v in pairs(files) do
+ print("Copy",v,dest_path .. path.getname(v))
+ os.copyfile(v,dest_path .. path.getname(v))
+ end
+ files = os.matchfiles(source_path .. "*.pdb")
+ for _,v in pairs(files) do
+ print("Copy",v,dest_path .. path.getname(v))
+ os.copyfile(v,dest_path .. path.getname(v))
+ end
+ end
+}
+
+if not _ACTION or _ACTION=="make" or _ACTION=="stage" then
+ return
+end
+
+
+-- helpers
+local mapActionToCompilerName = {
+ ["vs2005"] = "vc80",
+ ["vs2008"] = "vc90",
+ ["gmake"] = "gcc",
+}
+
+-- create 'yake/config.h'
+function bool_to_int(var)
+ if var then
+ return 1
+ else
+ return 0
+ end
+end
+function make_config_h()
+ local filename = ROOT_DIR .. "yake/config.h"
+ local f = io.open(filename, "w")
+ if not f then
+ print("ERROR: Unable to create [yake]/yake/config.h")
+ return false
+ end
+ f:write("// This file is auto-generated. Do not modify manually.\n")
+ f:write("\n")
+ f:write("#ifndef YAKE_CONFIG_H\n")
+ f:write("#define YAKE_CONFIG_H\n")
+ f:write("\n")
+ f:write("#define YAKE_DEBUG_DLL_SUFFIX \"" .. DEBUG_DLL_SUFFIX .. "\"\n")
+ f:write("#define YAKE_LIBFILE_PREFIX \"" .. LIBFILE_PREFIX .. "\"\n")
+ f:write("#define YAKE_LUA_BINDINGS " .. bool_to_int(LUA_BINDINGS) .. "\n")
+ f:write("#define YAKE_ENABLE_LUA_BASE " .. bool_to_int(ENABLE_LUA_BASE) .. "\n")
+ --[[
+ f:write("#define YAKE_ENABLE_LUA_MODEL " .. bool_to_int(ENABLE_LUA_MODEL) .. "\n")
+ f:write("#define YAKE_ENABLE_LUA_TASK " .. bool_to_int(ENABLE_LUA_TASK) .. "\n")
+ f:write("#define YAKE_ENABLE_LUA_ENT " .. bool_to_int(ENABLE_LUA_ENT) .. "\n")
+ f:write("#define YAKE_ENABLE_LUA_PROPERTY " .. bool_to_int(ENABLE_LUA_PROPERTY) .. "\n")
+ f:write("#define YAKE_ENABLE_LUA_GRAPHICS " .. bool_to_int(ENABLE_LUA_GRAPHICS) .. "\n")
+ f:write("#define YAKE_ENABLE_LUA_GRAPHICS_OGRE " .. bool_to_int(ENABLE_LUA_GRAPHICS_OGRE) .. "\n")
+ f:write("#define YAKE_ENABLE_LUA_PHYSICS " .. bool_to_int(ENABLE_LUA_PHYSICS) .. "\n")
+ f:write("#define YAKE_ENABLE_LUA_INPUT " .. bool_to_int(ENABLE_LUA_INPUT) .. "\n")
+ f:write("#define YAKE_ENABLE_LUA_RAF " .. bool_to_int(ENABLE_LUA_RAF) .. "\n")
+ f:write("#define YAKE_ENABLE_LUA_RES " .. bool_to_int(ENABLE_LUA_RES) .. "\n")
+ f:write("#define YAKE_ENABLE_LUA_UI " .. bool_to_int(ENABLE_LUA_UI) .. "\n")
+ f:write("\n")
+ f:write("#define YAKE_RAF_USES_CEGUI " .. bool_to_int(ENABLE_RAF_CEGUI) .. "\n")
+ f:write("#define YAKE_GRAPHICSOGRE_USES_OSM " .. bool_to_int(ENABLE_GRAPHICSOGRE_OSM_SUPPORT) .. "\n")
+ ]]--
+ f:write("\n")
+ f:write("#endif\n")
+ io.close(f)
+ return true
+end
+if not make_config_h() then
+ return 2
+end
+
+
+--
+solution "yake"
+ configurations { "DebugDLL", "ReleaseDLL", "DebugLib", "ReleaseLib" }
+
+ -- Add "native" as first element in the list to allow premake to select the 'default' bejaviour.
+ --platforms { "x32", "x64" }
+
+ -- We put project files into specific directories (e.g. "vs2008", "gcc" ...)
+ location ( ROOT_DIR .. "build/" .. _ACTION )
+ objdir ( ROOT_DIR .. "build/" .. _ACTION .. "/obj" )
+
+ if os.is("windows") then -- TODO actually it's "is VC++"
+ configuration { "Debug", "DebugDLL", "DebugLib", "Release", "ReleaseDLL", "ReleaseLib" }
+ defines { "NOMINMAX", "WIN32_LEAN_AND_MEAN" }
+ end
+
+ configuration { "Debug", "DebugDLL", "DebugLib" }
+ defines { "_DEBUG" }
+ flags { "Symbols" }
+ configuration { "Release", "ReleaseDLL", "ReleaseLib" }
+ defines { "NDEBUG" }
+ flags { "Optimize" }
+ -- dynamic targets:
+ configuration { "DebugDLL" }
+ kind "SharedLib"
+ defines { "_DEBUG", "_DLL" }
+ configuration { "ReleaseDLL" }
+ kind "SharedLib"
+ defines { "NDEBUG", "_DLL" }
+ -- static targets:
+ configuration { "DebugLib" }
+ kind "SharedLib"
+ defines { "_DEBUG" }
+ configuration { "ReleaseLib" }
+ kind "SharedLib"
+ defines { "NDEBUG" }
+
+-- kind (solution/project/configuration): ConsoleApp, WindowedApp, SharedLib, StaticLib
+--[[project "base"
+ location ( ROOT_DIR .. "build/" .. _ACTION )
+ language "C++"
+ files { "src/base/**.cpp", "yake/base/**.h" }
+ configuration "DebugDLL"
+ kind "SharedLib"
+ configuration "ReleaseDLL"
+ kind "SharedLib"
+ configuration "DebugLib"
+ kind "StaticLib"
+ configuration "ReleaseLib"
+ kind "StaticLib"
+--]]
+local function project_lib_basic(name,opt)
+ assert(name,"no name specified for project_lib")
+ local opt = opt or {}
+ --opt.require_package = opt.require_package or {}
+
+ project(name)
+ language "C++"
+
+ --targetdir ( ROOT_DIR .. "build/stage/" )
+ targetdir ( ROOT_DIR .. "build/" .. _ACTION .. "/bin" )
+
+ includedirs { ROOT_DIR .. "" }
+ require_package_incs( opt.require_package )
+
+ if opt.files then files(opt.files) end
+
+ configuration "ReleaseDLL"
+ targetname(name.."_"..mapActionToCompilerName[_ACTION])
+ defines { "YAKE_" .. name:upper() .. "_EXPORTS" }
+ require_package_links( "ReleaseDLL", opt.require_package )
+ if os.is("windows") then links { "winmm" } end -- for timeGetTime
+ configuration "DebugDLL"
+ targetname(name.."_"..mapActionToCompilerName[_ACTION].."_d")
+ defines { "YAKE_" .. name:upper() .. "_EXPORTS" }
+ require_package_links( "DebugDLL", opt.require_package )
+ if os.is("windows") then links { "winmm" } end -- for timeGetTime
+ configuration "ReleaseLib"
+ targetname(name.."_"..mapActionToCompilerName[_ACTION].."_s")
+ require_package_links( "ReleaseLib", opt.require_package )
+ configuration "DebugLib"
+ targetname(name.."_"..mapActionToCompilerName[_ACTION].."_sd")
+ require_package_links( "DebugLib", opt.require_package )
+end
+local function project_lib(name,opt)
+ opt = opt or {}
+ project_lib_basic(name,opt)
+ files {
+ ROOT_DIR .. "src/"..name.."/**.cpp",
+ ROOT_DIR .. "yake/"..name.."/**.h",
+ ROOT_DIR .. "yake/"..name.."/**.inl"
+ }
+end
+local function requires_lib( name )
+ includedirs { ROOT_DIR .. "yake/" .. name .. "/**" }
+ links { name }
+end
+local function project_exe(name)
+ assert(name,"no name specified for project_lib")
+ project(name)
+ location ( ROOT_DIR .. "build/" .. _ACTION )
+ language "C++"
+ kind "ConsoleApp"
+ files { ROOT_DIR .. "src/"..name.."/**.cpp", ROOT_DIR .. "yake/"..name.."/**.h" }
+ links { "base" }
+ configuration "Debug"
+ configuration "Release"
+end
+project_lib_basic( "base",
+ { files = { ROOT_DIR .. "src/base/*.cpp", ROOT_DIR .. "src/base/math/*.cpp", ROOT_DIR .. "src/base/templates/*.cpp",
+ ROOT_DIR .. "yake/base/*.h", ROOT_DIR .. "yake/base/math/*.h", ROOT_DIR .. "yake/base/templates/*.h",
+ },
+ require_package = {"boost","lua"}
+ })
+ configuration { "windows" }
+ files { ROOT_DIR .. "src/base/native/win32/*.cpp",
+ ROOT_DIR .. "src/base/native/win32/*.h"
+ }
+ configuration { "linux" }
+ files { ROOT_DIR .. "src/base/native/linux/*.cpp",
+ ROOT_DIR .. "src/base/native/linux/*.h"
+ }
+
+--project_lib "audio"
+project_lib("audio", {require_package = {"boost","lua"}})
+ --links { "base" }
+ requires_lib "base"
+
+for k,v in pairs(_OPTIONS) do print("OPT",k,v) end
+if not _OPTIONS["without-demos"] then
+ project_exe "demo2"
+ requires_lib "base"
+end
+--[[
+project "demo1"
+ location ( ROOT_DIR .. "build/" .. _ACTION )
+ kind "ConsoleApp"
+ language "C++"
+ files { "src/base/**.cpp", "yake/base/**.h" }
+ --links { "base" }
+ requires_lib "base"
+ configuration "Debug"
+ configuration "Release"
+]]--
+
+if _ACTION == "clean" then
+ os.rmdir("build")
+end
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <psy...@us...> - 2009-06-22 16:02:16
|
Revision: 1980
http://yake.svn.sourceforge.net/yake/?rev=1980&view=rev
Author: psyclonist
Date: 2009-06-22 16:02:15 +0000 (Mon, 22 Jun 2009)
Log Message:
-----------
Copied remotely
Added Paths:
-----------
branches/yake2/
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <psy...@us...> - 2009-06-15 20:15:51
|
Revision: 1979
http://yake.svn.sourceforge.net/yake/?rev=1979&view=rev
Author: psyclonist
Date: 2009-06-15 19:41:32 +0000 (Mon, 15 Jun 2009)
Log Message:
-----------
added missing sampleUi1.cfg
Added Paths:
-----------
branches/v0-8-0/yake/samples/bin/debug/sampleUi1.cfg
branches/v0-8-0/yake/samples/bin/release/sampleUi1.cfg
Added: branches/v0-8-0/yake/samples/bin/debug/sampleUi1.cfg
===================================================================
--- branches/v0-8-0/yake/samples/bin/debug/sampleUi1.cfg (rev 0)
+++ branches/v0-8-0/yake/samples/bin/debug/sampleUi1.cfg 2009-06-15 19:41:32 UTC (rev 1979)
@@ -0,0 +1,18 @@
+[resource.sources] # <- evaluated by RAF
+file=../../../common/media/scripts/ # <- do NOT forget trialing '/' !!
+file=../../../common/media/gui2/styles/lua1/
+
+#-----------------------------------
+[raf.startup.libraries]
+# Libraries to be loaded automatically at startup
+
+graphicsOgre
+inputOgreOIS
+scriptingLua
+
+#-----------------------------------
+[raf.startup.systems]
+# System to be created & initialized automatically
+
+graphics=ogre3d
+input=ois
Added: branches/v0-8-0/yake/samples/bin/release/sampleUi1.cfg
===================================================================
--- branches/v0-8-0/yake/samples/bin/release/sampleUi1.cfg (rev 0)
+++ branches/v0-8-0/yake/samples/bin/release/sampleUi1.cfg 2009-06-15 19:41:32 UTC (rev 1979)
@@ -0,0 +1,18 @@
+[resource.sources] # <- evaluated by RAF
+file=../../../common/media/scripts/ # <- do NOT forget trialing '/' !!
+file=../../../common/media/gui2/styles/lua1/
+
+#-----------------------------------
+[raf.startup.libraries]
+# Libraries to be loaded automatically at startup
+
+graphicsOgre
+inputOgreOIS
+scriptingLua
+
+#-----------------------------------
+[raf.startup.systems]
+# System to be created & initialized automatically
+
+graphics=ogre3d
+input=ois
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <psy...@us...> - 2009-05-23 09:59:51
|
Revision: 1978
http://yake.svn.sourceforge.net/yake/?rev=1978&view=rev
Author: psyclonist
Date: 2009-05-23 09:59:49 +0000 (Sat, 23 May 2009)
Log Message:
-----------
updated DEPENDENCIES
Modified Paths:
--------------
trunk/yake/dependencies/DEPENDENCIES
Modified: trunk/yake/dependencies/DEPENDENCIES
===================================================================
--- trunk/yake/dependencies/DEPENDENCIES 2009-04-07 21:56:02 UTC (rev 1977)
+++ trunk/yake/dependencies/DEPENDENCIES 2009-05-23 09:59:49 UTC (rev 1978)
@@ -40,7 +40,7 @@
--------------------------------------------------
-dependencies
+essential dependencies
--------------------------------------------------
boost/ minimum: >= 1.34.0
@@ -57,6 +57,10 @@
direct download: http://www.boost-consulting.com/vault/index.php?action=downloadfile&filename=property_tree_rev5.zip&directory=&
installation: extract into 'dependencies/boost/'
+--------------------------------------------------
+optional dependencies
+--------------------------------------------------
+
lua/ minimum: >= 5.1.x
current: 5.1.3
sources: http://www.lua.org/download.html lua-5.1.3.tar.gz (or later)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <psy...@us...> - 2009-04-07 21:56:06
|
Revision: 1977
http://yake.svn.sourceforge.net/yake/?rev=1977&view=rev
Author: psyclonist
Date: 2009-04-07 21:56:02 +0000 (Tue, 07 Apr 2009)
Log Message:
-----------
ent: try a different default c'tor to please some version of vc2008 (9.0)
Modified Paths:
--------------
branches/v0-8-0/yake/yake/model/model_component.h
Modified: branches/v0-8-0/yake/yake/model/model_component.h
===================================================================
--- branches/v0-8-0/yake/yake/model/model_component.h 2009-03-26 15:37:40 UTC (rev 1976)
+++ branches/v0-8-0/yake/yake/model/model_component.h 2009-04-07 21:56:02 UTC (rev 1977)
@@ -216,16 +216,20 @@
{
typedef T* pointer;
pointer p_;
- EntryT(pointer p = pointer()) : p_(p)
+ EntryT() : p_(0)
{}
+ EntryT(pointer p) : p_(p)
+ {}
};
template<typename T>
struct EntrySharedT
{
typedef SharedPtr<T> pointer;
pointer p_;
- EntrySharedT(pointer p = pointer()) : p_(p)
+ EntrySharedT()
{}
+ EntrySharedT(pointer p) : p_(p)
+ {}
};
typedef AssocVector<String,EntryT<physics::IActor> > TagActorMap;
typedef AssocVector<String,EntryT<physics::IBody> > TagBodyMap;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <psy...@us...> - 2009-03-26 15:37:45
|
Revision: 1976
http://yake.svn.sourceforge.net/yake/?rev=1976&view=rev
Author: psyclonist
Date: 2009-03-26 15:37:40 +0000 (Thu, 26 Mar 2009)
Log Message:
-----------
msvc90/make_all.cmd: cleaned up & fixed for vc90
Modified Paths:
--------------
trunk/yake/scripts/msvc90/make_all.cmd
Modified: trunk/yake/scripts/msvc90/make_all.cmd
===================================================================
--- trunk/yake/scripts/msvc90/make_all.cmd 2009-03-25 20:26:57 UTC (rev 1975)
+++ trunk/yake/scripts/msvc90/make_all.cmd 2009-03-26 15:37:40 UTC (rev 1976)
@@ -6,28 +6,34 @@
echo ERROR: yake.sln not found. Did you run build.cmd?
goto end
)
-if $"%VS80COMNTOOLS%"$ == $""$ (
- echo ERROR: System variable VS80COMNTOOLS not set!
+echo VS90COMNTOOLS = %VS90COMNTOOLS%
+if $"%VS90COMNTOOLS%"$ == $""$ (
+ echo ERROR: System variable VS90COMNTOOLS not set!
echo Is Visual Studio 2005 installed?
goto end
)
-if not exist "%VS80COMNTOOLS%..\IDE\devenv.com" (
- echo ERROR: Could not locate Visual Studio's devenv.com.
- echo File: %VS80COMNTOOLS%..\IDE\devenv.com
- echo.
- goto end
-)
+SET YAKE_VSCOMNTOOLS=%VS90COMNTOOLS%
+rem now remove quotes (original found here -> http://www.ss64.com/nt/syntax-esc.html)
+SET YAKE_VSCOMNTOOLS=###%YAKE_VSCOMNTOOLS%###
+SET YAKE_VSCOMNTOOLS=%YAKE_VSCOMNTOOLS:"###=%
+SET YAKE_VSCOMNTOOLS=%YAKE_VSCOMNTOOLS:###"=%
+SET YAKE_VSCOMNTOOLS=%YAKE_VSCOMNTOOLS:###=%
+echo YAKE_VSCOMNTOOLS=%YAKE_VSCOMNTOOLS%
+set YAKE_DEVENVEXE="%YAKE_VSCOMNTOOLS%..\IDE\devenv"
+echo YAKE_DEVENVEXE=%YAKE_DEVENVEXE%
+
+echo.
echo Starting build for 'Debug' target...
-call "%VS80COMNTOOLS%..\IDE\devenv.com" /build Debug yake.sln 2>&1 | find "error(s)"
+call %YAKE_DEVENVEXE% /build Debug yake.sln 2>&1 | find "error(s)"
echo Starting build for 'DebugLib' target...
-call "%VS80COMNTOOLS%..\IDE\devenv.com" /build DebugLib yake.sln 2>&1 | find "error(s)"
+call %YAKE_DEVENVEXE% /build DebugLib yake.sln 2>&1 | find "error(s)"
echo Starting build for 'Release' target...
-call "%VS80COMNTOOLS%..\IDE\devenv.com" /build Release yake.sln 2>&1 | find "error(s)"
+call %YAKE_DEVENVEXE% /build Release yake.sln 2>&1 | find "error(s)"
echo Starting build for 'ReleaseLib' target...
-call "%VS80COMNTOOLS%..\IDE\devenv.com" /build ReleaseLib yake.sln 2>&1 | find "error(s)"
+call %YAKE_DEVENVEXE%/build ReleaseLib yake.sln 2>&1 | find "error(s)"
echo Starting build for 'ReleaseWithSymbols' target...
-call "%VS80COMNTOOLS%..\IDE\devenv.com" /build ReleaseWithSymbols yake.sln 2>&1 | find "error(s)"
+call%YAKE_DEVENVEXE% /build ReleaseWithSymbols yake.sln 2>&1 | find "error(s)"
:end
pause
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <psy...@us...> - 2009-03-25 20:27:08
|
Revision: 1975
http://yake.svn.sourceforge.net/yake/?rev=1975&view=rev
Author: psyclonist
Date: 2009-03-25 20:26:57 +0000 (Wed, 25 Mar 2009)
Log Message:
-----------
model: added default c'tor
Modified Paths:
--------------
branches/v0-8-0/yake/yake/model/model_component.h
Modified: branches/v0-8-0/yake/yake/model/model_component.h
===================================================================
--- branches/v0-8-0/yake/yake/model/model_component.h 2009-03-25 19:35:56 UTC (rev 1974)
+++ branches/v0-8-0/yake/yake/model/model_component.h 2009-03-25 20:26:57 UTC (rev 1975)
@@ -216,7 +216,7 @@
{
typedef T* pointer;
pointer p_;
- EntryT(pointer p) : p_(p)
+ EntryT(pointer p = pointer()) : p_(p)
{}
};
template<typename T>
@@ -224,7 +224,7 @@
{
typedef SharedPtr<T> pointer;
pointer p_;
- EntrySharedT(pointer p) : p_(p)
+ EntrySharedT(pointer p = pointer()) : p_(p)
{}
};
typedef AssocVector<String,EntryT<physics::IActor> > TagActorMap;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <psy...@us...> - 2009-03-25 19:36:12
|
Revision: 1974
http://yake.svn.sourceforge.net/yake/?rev=1974&view=rev
Author: psyclonist
Date: 2009-03-25 19:35:56 +0000 (Wed, 25 Mar 2009)
Log Message:
-----------
Copied remotely
Added Paths:
-----------
branches/v0-8-0/
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <psy...@us...> - 2009-03-17 18:21:31
|
Revision: 1973
http://yake.svn.sourceforge.net/yake/?rev=1973&view=rev
Author: psyclonist
Date: 2009-03-17 18:21:26 +0000 (Tue, 17 Mar 2009)
Log Message:
-----------
added vc90 debug settings
Added Paths:
-----------
trunk/yake/scripts/msvc90/yake.suo
Added: trunk/yake/scripts/msvc90/yake.suo
===================================================================
(Binary files differ)
Property changes on: trunk/yake/scripts/msvc90/yake.suo
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <psy...@us...> - 2009-03-17 17:56:53
|
Revision: 1972
http://yake.svn.sourceforge.net/yake/?rev=1972&view=rev
Author: psyclonist
Date: 2009-03-17 17:56:43 +0000 (Tue, 17 Mar 2009)
Log Message:
-----------
premake/tools.lua: define WIN32_LEAN_AND_MEAN on Windows builds
Modified Paths:
--------------
trunk/yake/scripts/premake/tools.lua
Modified: trunk/yake/scripts/premake/tools.lua
===================================================================
--- trunk/yake/scripts/premake/tools.lua 2009-03-17 17:56:10 UTC (rev 1971)
+++ trunk/yake/scripts/premake/tools.lua 2009-03-17 17:56:43 UTC (rev 1972)
@@ -191,6 +191,7 @@
addDefine("WIN32")
addDefine("_WINDOWS")
addDefine("NOMINMAX") -- avoid min and max macros as they collide with std::min() and std::max()
+ addDefine("WIN32_LEAN_AND_MEAN") -- in case any windows headers are picked up. (also solves some include issue w/ boost::asio)
if not cb_gcc then --MSVC:
addDefine("_CRT_SECURE_NO_DEPRECATE")
addDefine("_CRT_NOFORCE_MANIFEST") -- No manifests for DLLs. Let the executable decide.
@@ -521,6 +522,7 @@
if (windows) then
addDefine("_CRT_SECURE_NO_DEPRECATE")
addDefine("WIN32")
+ addDefine("WIN32_LEAN_AND_MEAN")
elseif (linux) then
addDefine("_REENTRANT")
end
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <psy...@us...> - 2009-03-17 17:56:18
|
Revision: 1971
http://yake.svn.sourceforge.net/yake/?rev=1971&view=rev
Author: psyclonist
Date: 2009-03-17 17:56:10 +0000 (Tue, 17 Mar 2009)
Log Message:
-----------
net2: adjusted to change in error policy of boost::asio 1.37.0+
Modified Paths:
--------------
trunk/yake/samples/net2/message1/demo.cpp
trunk/yake/samples/net2/message2/demo.cpp
trunk/yake/yake/net2/packet_connection.h
trunk/yake/yake/net2/server.h
Modified: trunk/yake/samples/net2/message1/demo.cpp
===================================================================
--- trunk/yake/samples/net2/message1/demo.cpp 2009-03-03 19:48:16 UTC (rev 1970)
+++ trunk/yake/samples/net2/message1/demo.cpp 2009-03-17 17:56:10 UTC (rev 1971)
@@ -1,8 +1,6 @@
#include <yake/base/yakePrerequisites.h>
#include <yake/base/yake.h> // for YAKE_ASSERT etc
#include <yake/net2/net.h>
-#undef min
-#undef max
#include <boost/bind.hpp>
@@ -227,9 +225,9 @@
netThread.join();
}
}
- catch (boost::asio::error& ex)
+ catch (boost::system::error_code& ex)
{
- YAKE_LOG_ERROR("demo",String("ASIO EXCEPTION: ") + ex.what());
+ YAKE_LOG_ERROR("demo",String("ASIO EXCEPTION: ") + ex.message());
}
catch (std::exception& ex)
{
Modified: trunk/yake/samples/net2/message2/demo.cpp
===================================================================
--- trunk/yake/samples/net2/message2/demo.cpp 2009-03-03 19:48:16 UTC (rev 1970)
+++ trunk/yake/samples/net2/message2/demo.cpp 2009-03-17 17:56:10 UTC (rev 1971)
@@ -1,5 +1,8 @@
#include <yake/base/yakePrerequisites.h>
+#define NOMINMAX
+#include <WinSock2.h>
#include <yake/base/yake.h> // for YAKE_ASSERT etc
+
#include <yake/net2/net.h>
#undef min
#undef max
@@ -491,9 +494,9 @@
netThread.join();
}
}
- catch (boost::asio::error& ex)
+ catch (boost::system::error_code& ex)
{
- YAKE_LOG_ERROR("demo",String("ASIO EXCEPTION: ") + ex.what());
+ YAKE_LOG_ERROR("demo",String("ASIO EXCEPTION: ") + ex.message());
}
catch (std::exception& ex)
{
Modified: trunk/yake/yake/net2/packet_connection.h
===================================================================
--- trunk/yake/yake/net2/packet_connection.h 2009-03-03 19:48:16 UTC (rev 1970)
+++ trunk/yake/yake/net2/packet_connection.h 2009-03-17 17:56:10 UTC (rev 1971)
@@ -140,14 +140,14 @@
}
private:
using boost::enable_shared_from_this<TCPPacketConnection<PacketType> >::shared_from_this;
- void onConnectionTimeout(const boost::asio::error& e)
+ void onConnectionTimeout(const boost::system::error_code& e)
{
if (e == boost::asio::error::operation_aborted)
return;
//std::cerr << "nc: connection attempt timed out.\n";
doStop(Error::time_out);
}
- void onResolved(const boost::asio::error& e, tcp::resolver::iterator endptIt)
+ void onResolved(const boost::system::error_code& e, tcp::resolver::iterator endptIt)
{
if (e)
{
@@ -162,7 +162,7 @@
socket_->async_connect( endpt,
boost::bind(&TCPPacketConnection::handleConnect,shared_from_this(),boost::asio::placeholders::error,++endptIt) );
}
- void handleConnect(const boost::asio::error& e, tcp::resolver::iterator endptIt)
+ void handleConnect(const boost::system::error_code& e, tcp::resolver::iterator endptIt)
{
if (!e)
{
@@ -216,7 +216,7 @@
this->async_write_first_in_queue();
}
}
- void handleReadHeader(const boost::asio::error& e, size_t bytes_transferred)
+ void handleReadHeader(const boost::system::error_code& e, size_t bytes_transferred)
{
if (e)
{
@@ -262,7 +262,7 @@
}
}
}
- void handleReadBody(const boost::asio::error& e, size_t bytes_transferred)
+ void handleReadBody(const boost::system::error_code& e, size_t bytes_transferred)
{
stats_.in_.totalBytes_ += bytes_transferred;
@@ -311,8 +311,8 @@
//
if (socket_)
{
- boost::asio::error err;
- socket_->close(boost::asio::assign_error(err));
+ boost::system::error_code err;
+ socket_->close(err);
}
handler_( e );
@@ -335,7 +335,7 @@
this->async_write_first_in_queue();
}
}
- void handleWrite(const boost::asio::error& error, size_t bytes_transferred)
+ void handleWrite(const boost::system::error_code& error, size_t bytes_transferred)
{
stats_.out_.totalBytes_ += bytes_transferred;
Modified: trunk/yake/yake/net2/server.h
===================================================================
--- trunk/yake/yake/net2/server.h 2009-03-03 19:48:16 UTC (rev 1970)
+++ trunk/yake/yake/net2/server.h 2009-03-17 17:56:10 UTC (rev 1971)
@@ -213,7 +213,7 @@
}
// NB In handleAccept() we can let the connection_ptr go out of scope safely
// as conn->startAsServerConnection() controls its own lifetime via shared_from_this().
- void handleAccept(ConnectionHandler connHandler, PacketHandler pcktHandler, connection_ptr conn, const boost::asio::error& error)
+ void handleAccept(ConnectionHandler connHandler, PacketHandler pcktHandler, connection_ptr conn, const boost::system::error_code& error)
{
if (!error)
{
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <psy...@us...> - 2009-03-03 19:48:20
|
Revision: 1970
http://yake.svn.sourceforge.net/yake/?rev=1970&view=rev
Author: psyclonist
Date: 2009-03-03 19:48:16 +0000 (Tue, 03 Mar 2009)
Log Message:
-----------
sample task/demo1: added missing include
Modified Paths:
--------------
trunk/yake/samples/task/demo1/demo.cpp
Modified: trunk/yake/samples/task/demo1/demo.cpp
===================================================================
--- trunk/yake/samples/task/demo1/demo.cpp 2009-03-03 19:35:57 UTC (rev 1969)
+++ trunk/yake/samples/task/demo1/demo.cpp 2009-03-03 19:48:16 UTC (rev 1970)
@@ -1,5 +1,6 @@
#include <yake/task/task.h>
#include <boost/bind.hpp>
+#include <iostream>
void print(yake::task::executor_ptr exec, size_t t)
{
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <psy...@us...> - 2009-03-03 19:35:59
|
Revision: 1969
http://yake.svn.sourceforge.net/yake/?rev=1969&view=rev
Author: psyclonist
Date: 2009-03-03 19:35:57 +0000 (Tue, 03 Mar 2009)
Log Message:
-----------
* base: removed unnecessary includes to improve build time
* res: removed superfluous console output
Modified Paths:
--------------
trunk/yake/src/base/yakeException.cpp
trunk/yake/src/res/datastream.cpp
trunk/yake/yake/base/templates/yakeSignals.h
trunk/yake/yake/base/yakeConfigFile.h
trunk/yake/yake/base/yakePrerequisites.h
trunk/yake/yake/base/yakeString.h
Modified: trunk/yake/src/base/yakeException.cpp
===================================================================
--- trunk/yake/src/base/yakeException.cpp 2009-03-03 18:29:24 UTC (rev 1968)
+++ trunk/yake/src/base/yakeException.cpp 2009-03-03 19:35:57 UTC (rev 1969)
@@ -30,6 +30,7 @@
//============================================================================
#include <yake/base/yakePCH.h>
#include <yake/base/yakeException.h>
+#include <sstream>
//============================================================================
// INTERFACE STRUCTURES / UTILITY CLASSES
Modified: trunk/yake/src/res/datastream.cpp
===================================================================
--- trunk/yake/src/res/datastream.cpp 2009-03-03 18:29:24 UTC (rev 1968)
+++ trunk/yake/src/res/datastream.cpp 2009-03-03 19:35:57 UTC (rev 1969)
@@ -49,7 +49,6 @@
YAKE_ASSERT( succ == 0 ).debug("failed to seek to end");
size_ = ftell(in_);
- std::cout << "file '" << fn << "' has length " << size_ << " byte(s) (ftell)\n";
//succ = fseek(in_, 0, SEEK_SET);
::rewind(in_);
Modified: trunk/yake/yake/base/templates/yakeSignals.h
===================================================================
--- trunk/yake/yake/base/templates/yakeSignals.h 2009-03-03 18:29:24 UTC (rev 1968)
+++ trunk/yake/yake/base/templates/yakeSignals.h 2009-03-03 19:35:57 UTC (rev 1969)
@@ -55,10 +55,8 @@
//
// Best regards, Kerim (mailto:warkid at hotbox.ru)
//
-# include "boost/bind.hpp"
#elif defined( YAKE_SIGNALS_USE_TTL )
# include <ttl/sig/signal.hpp>
-# include <boost/bind.hpp>
#endif
#if defined( YAKE_SIGNALS_USE_BOOST )
Modified: trunk/yake/yake/base/yakeConfigFile.h
===================================================================
--- trunk/yake/yake/base/yakeConfigFile.h 2009-03-03 18:29:24 UTC (rev 1968)
+++ trunk/yake/yake/base/yakeConfigFile.h 2009-03-03 19:35:57 UTC (rev 1969)
@@ -44,7 +44,7 @@
//#undef TIXML_USE_STL
//#endif
#include <boost/property_tree/ptree.hpp>
-#include <boost/property_tree/xml_parser.hpp>
+//#include <boost/property_tree/xml_parser.hpp>
#include <boost/property_tree/info_parser.hpp>
#if YAKE_COMPILER == COMPILER_MSVC
#pragma warning(pop)
@@ -137,7 +137,6 @@
void readFromFile(const String& fn, const String& insertAt = "");
/** Overwrites existing configuration values if conflicts appear!
*/
- //@todo void readFromXML(const String& fn, const String& insertAt = "");
/**
@note Ignores any set offset/prefix!
*/
@@ -145,7 +144,6 @@
/**
@note Ignores any set offset/prefix!
*/
- //@todo void writeToXML(const String& fn, const String& startAt = "");
private:
tree_ptr tree_;
Modified: trunk/yake/yake/base/yakePrerequisites.h
===================================================================
--- trunk/yake/yake/base/yakePrerequisites.h 2009-03-03 18:29:24 UTC (rev 1968)
+++ trunk/yake/yake/base/yakePrerequisites.h 2009-03-03 19:35:57 UTC (rev 1969)
@@ -44,21 +44,14 @@
#include <math.h>
#include <cmath>
#include <limits>
-#include <cstdio>
-#include <stdio.h>
-#include <stdarg.h>
#include <string>
#include <stdexcept>
-#include <locale>
#include <algorithm>
-#include <functional>
#include <vector>
#include <map>
#include <list>
#include <queue>
#include <set>
-#include <iostream>
-#include <sstream>
#ifdef __SGI_STL
# include <iterator>
Modified: trunk/yake/yake/base/yakeString.h
===================================================================
--- trunk/yake/yake/base/yakeString.h 2009-03-03 18:29:24 UTC (rev 1968)
+++ trunk/yake/yake/base/yakeString.h 2009-03-03 19:35:57 UTC (rev 1969)
@@ -34,6 +34,7 @@
#include <yake/base/yakePrerequisites.h>
#include <yake/base/templates/yakeVector.h>
#include <yake/base/templates/yakeFastMap.h>
+#include <sstream>
//============================================================================
// INTERFACE STRUCTURES / UTILITY CLASSES
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <psy...@us...> - 2009-03-03 18:29:26
|
Revision: 1968
http://yake.svn.sourceforge.net/yake/?rev=1968&view=rev
Author: psyclonist
Date: 2009-03-03 18:29:24 +0000 (Tue, 03 Mar 2009)
Log Message:
-----------
* samples: updated configuration files
Modified Paths:
--------------
trunk/yake/samples/bin/debug/yake.graphics.ogre_plugins.cfg
trunk/yake/samples/bin/release/yake.graphics.ogre_plugins.cfg
trunk/yake/samples/bin/release/yake.graphics.ogre_resources.cfg
Modified: trunk/yake/samples/bin/debug/yake.graphics.ogre_plugins.cfg
===================================================================
--- trunk/yake/samples/bin/debug/yake.graphics.ogre_plugins.cfg 2009-03-03 18:20:14 UTC (rev 1967)
+++ trunk/yake/samples/bin/debug/yake.graphics.ogre_plugins.cfg 2009-03-03 18:29:24 UTC (rev 1968)
@@ -1,4 +1,4 @@
-PluginFolder=OgrePlugins
+PluginFolder=.
Plugin=RenderSystem_Direct3D9_d.dll
Plugin=RenderSystem_GL_d.dll
Plugin=Plugin_OctreeSceneManager_d.dll
Modified: trunk/yake/samples/bin/release/yake.graphics.ogre_plugins.cfg
===================================================================
--- trunk/yake/samples/bin/release/yake.graphics.ogre_plugins.cfg 2009-03-03 18:20:14 UTC (rev 1967)
+++ trunk/yake/samples/bin/release/yake.graphics.ogre_plugins.cfg 2009-03-03 18:29:24 UTC (rev 1968)
@@ -1,7 +1,6 @@
-PluginFolder=OgrePlugins
-Plugin=RenderSystem_Direct3D9.dll
-#Plugin=RenderSystem_Direct3D7.dll
-Plugin=RenderSystem_GL.dll
-Plugin=Plugin_OctreeSceneManager.dll
-Plugin=Plugin_ParticleFX.dll
-Plugin=Plugin_CgProgramManager.dll
+PluginFolder=.
+Plugin=RenderSystem_Direct3D9_d.dll
+Plugin=RenderSystem_GL_d.dll
+Plugin=Plugin_OctreeSceneManager_d.dll
+Plugin=Plugin_ParticleFX_d.dll
+Plugin=Plugin_CgProgramManager_d.dll
Modified: trunk/yake/samples/bin/release/yake.graphics.ogre_resources.cfg
===================================================================
--- trunk/yake/samples/bin/release/yake.graphics.ogre_resources.cfg 2009-03-03 18:20:14 UTC (rev 1967)
+++ trunk/yake/samples/bin/release/yake.graphics.ogre_resources.cfg 2009-03-03 18:29:24 UTC (rev 1968)
@@ -25,3 +25,4 @@
FileSystem=../../../common/media/gui/lua_scripts/
FileSystem=../../../common/media/gui/schemes/
Zip=../../../common/media/skybox.zip
+FileSystem=../../../common/media/gui2/styles/lua1/
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <psy...@us...> - 2009-03-03 18:20:21
|
Revision: 1967
http://yake.svn.sourceforge.net/yake/?rev=1967&view=rev
Author: psyclonist
Date: 2009-03-03 18:20:14 +0000 (Tue, 03 Mar 2009)
Log Message:
-----------
formatting only
Modified Paths:
--------------
trunk/yake/scripts/premake/tools.lua
Modified: trunk/yake/scripts/premake/tools.lua
===================================================================
--- trunk/yake/scripts/premake/tools.lua 2009-03-03 18:19:37 UTC (rev 1966)
+++ trunk/yake/scripts/premake/tools.lua 2009-03-03 18:20:14 UTC (rev 1967)
@@ -510,7 +510,7 @@
package.buildflags = {"no-pch"}
- package.buildoptions = {}
+ package.buildoptions = {}
if (linux or cb_gcc) then --TODO should be 'if gcc'
package.buildoptions = {"-s"}
end
@@ -562,14 +562,14 @@
releaseLib.defines = {"YAKE_STATIC"}
releaseLib.buildflags = {"no-pch"}
- -- add sources
- addMatching(path.."/*.cpp")
- addMatching(path.."/*.h")
- addMatching(path.."/*.inl")
+ -- add sources
+ addMatching(path.."/*.cpp")
+ addMatching(path.."/*.h")
+ addMatching(path.."/*.inl")
- -- core dependencies
- useDep("boost")
-
+ -- core dependencies
+ useDep("boost")
+
end
-- Mostly used in samples.lua and custom.lua
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <psy...@us...> - 2009-03-03 18:19:40
|
Revision: 1966
http://yake.svn.sourceforge.net/yake/?rev=1966&view=rev
Author: psyclonist
Date: 2009-03-03 18:19:37 +0000 (Tue, 03 Mar 2009)
Log Message:
-----------
* build: deprecated projects depending on ENet (i.e. removed them by default, source is still available, can be enabled in config.lua)
Modified Paths:
--------------
trunk/yake/scripts/premake/samples.lua
Modified: trunk/yake/scripts/premake/samples.lua
===================================================================
--- trunk/yake/scripts/premake/samples.lua 2009-03-03 18:18:20 UTC (rev 1965)
+++ trunk/yake/scripts/premake/samples.lua 2009-03-03 18:19:37 UTC (rev 1966)
@@ -192,61 +192,13 @@
makeSample("sampleNetMessage1","samples/net2/message1")
sampleUsesConsole()
useComponent("base")
- --useComponent("net")
makeSample("sampleNetMessage2","samples/net2/message2")
sampleUsesConsole()
useComponent("base")
- --useComponent("net")
-
end
--------------------------------------
-if SAMPLES_NET then
- makeSample("sampleNetPacket","samples/net/packet")
- sampleUsesConsole()
- useComponent("base")
- useComponent("net")
-end
-
---------------------------------------
-if SAMPLES_NET and SAMPLES_USE_ASIO then
- makeSample("sampleNetInprocess","samples/net/inprocess")
- sampleUsesConsole()
- useComponent("base")
- useComponent("scripting")
- useComponent("net")
- useComponent("netsvc")
- useComponent("netrepsvc")
- useComponent("model")
- useComponent("ent")
- addMatching("samples/net/roclient/roclient*")
- addMatching("samples/net/roserver/roserver*")
-end
-
---------------------------------------
-if SAMPLES_NET then
- makeSample("sampleNetCommServer","samples/net/commserver")
- sampleUsesConsole()
- useComponent("base")
- useComponent("net")
- useComponent("netsvc")
- addIncludePath("dependencies/boost")
- addMatching("samples/net/roserver/roserver*")
-end
-
---------------------------------------
-if SAMPLES_NET then
- makeSample("sampleNetCommClient","samples/net/commclient")
- sampleUsesConsole()
- useComponent("base")
- useComponent("net")
- useComponent("netsvc")
- addIncludePath("dependencies/boost")
- addMatching("samples/net/roclient/roclient*")
-end
-
---------------------------------------
if LUA_BINDINGS then
makeSample("sampleScripting1","samples/base/scripting/lua")
sampleUsesConsole()
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <psy...@us...> - 2009-03-03 18:18:22
|
Revision: 1965
http://yake.svn.sourceforge.net/yake/?rev=1965&view=rev
Author: psyclonist
Date: 2009-03-03 18:18:20 +0000 (Tue, 03 Mar 2009)
Log Message:
-----------
* build: removed package GUIDs (package.guid) because they resulted in the projects not being enabled for the build configuration in Visual C++ 2008 (Solution > Configuration Manager).
* build: deprecated projects depending on ENet (i.e. removed them by default, source is still available, can be enabled in config.lua)
* build: disabled plugin audioOpenAL by default. can be enabled in config.lua.
* build: disabled Ogre/CEGUI renderer adapter plugin by default. can be enabled in config.lua.
Modified Paths:
--------------
trunk/yake/scripts/premake/config.lua
trunk/yake/scripts/premake/plugins.lua
trunk/yake/scripts/premake/yake.lua
Modified: trunk/yake/scripts/premake/config.lua
===================================================================
--- trunk/yake/scripts/premake/config.lua 2009-02-23 15:46:09 UTC (rev 1964)
+++ trunk/yake/scripts/premake/config.lua 2009-03-03 18:18:20 UTC (rev 1965)
@@ -29,7 +29,7 @@
--------------------------------------
-- NB only some of these options have effect
-PLUGIN_AUDIO_OPENAL = true
+PLUGIN_AUDIO_OPENAL = false
PLUGIN_AUDIO_FMOD = true
PLUGIN_GRAPHICS_OGRE = true
@@ -52,6 +52,8 @@
-- Dependency: "osm"
ENABLE_GRAPHICSOGRE_OSM_SUPPORT = false
+ENABLE_GRAPHICSOGRE_CEGUI_ADAPTER = false
+
--------------------------------------
-- Lua Bindings
--------------------------------------
Modified: trunk/yake/scripts/premake/plugins.lua
===================================================================
--- trunk/yake/scripts/premake/plugins.lua 2009-02-23 15:46:09 UTC (rev 1964)
+++ trunk/yake/scripts/premake/plugins.lua 2009-03-03 18:18:20 UTC (rev 1965)
@@ -79,7 +79,7 @@
end
--------------------------------------
-if (PLUGIN_INPUT_OGRE or PLUGIN_INPUT_OGRE_OIS) and PLUGIN_GRAPHICS_OGRE then
+if ENABLE_GRAPHICSOGRE_CEGUI_ADAPTER and (PLUGIN_INPUT_OGRE or PLUGIN_INPUT_OGRE_OIS) and PLUGIN_GRAPHICS_OGRE then
makeComponentPlugin("ceguiOgreRendererAdapter","YAKE_CEGUIRENDERERADAPTER_OGRE_EXPORTS")
addDependency("base")
addDependency("graphics")
Modified: trunk/yake/scripts/premake/yake.lua
===================================================================
--- trunk/yake/scripts/premake/yake.lua 2009-02-23 15:46:09 UTC (rev 1964)
+++ trunk/yake/scripts/premake/yake.lua 2009-03-03 18:18:20 UTC (rev 1965)
@@ -98,7 +98,7 @@
--------------------------------------
makePackage("base") -- we cannot use makeDLLComponent() because of native .cpp
- package.guid = "84C4540D-29E6-4a82-83D4-9A6D5FA29AEA"
+ --package.guid = "84C4540D-29E6-4a82-83D4-9A6D5FA29AEA"
addDefine("YAKE_BASE_EXPORTS")
--package.pchheader = "yake/base/yakePCH.h"
--package.pchsource = rootdir.."src/base/yakePCH.cpp"
@@ -130,32 +130,32 @@
--------------------------------------
makeComponent("graphics","YAKE_GRAPHICSINTERFACE_EXPORTS")
-package.guid = "2D6225E8-2B35-4b61-9259-6641A2A23D1D"
+--package.guid = "2D6225E8-2B35-4b61-9259-6641A2A23D1D"
addDependency("base")
--------------------------------------
makeComponent("audio","YAKE_AUDIO_EXPORTS")
-package.guid = "0C385E67-85C2-49ff-A2B0-0C4F817C9BEA"
+--package.guid = "0C385E67-85C2-49ff-A2B0-0C4F817C9BEA"
addDependency("base")
--------------------------------------
makeComponent("input","YAKE_INPUT_EXPORTS")
-package.guid = "00AAC1AE-935B-459f-8278-DAFA37597A14"
+--package.guid = "00AAC1AE-935B-459f-8278-DAFA37597A14"
addDependency("base")
--------------------------------------
makeComponent("physics","YAKE_PHYSICS_EXPORTS")
-package.guid = "C7B1016B-95C9-4089-A0E7-F57AEDA49938"
+--package.guid = "C7B1016B-95C9-4089-A0E7-F57AEDA49938"
addDependency("base")
--------------------------------------
makeComponent("scripting","YAKE_SCRIPTING_EXPORTS")
-package.guid = "EDD43870-469C-4eb7-BD67-D08346DBE960"
+--package.guid = "EDD43870-469C-4eb7-BD67-D08346DBE960"
addDependency("base")
--------------------------------------
makeComponent("data","YAKE_DATA_EXPORTS")
-package.guid = "DCF71344-0B5C-4e94-9CEA-431BD53F07D6"
+--package.guid = "DCF71344-0B5C-4e94-9CEA-431BD53F07D6"
-- Compile TinyXML into yake::data:
addMatching("dependencies/tinyxml/*.h")
@@ -165,7 +165,7 @@
--------------------------------------
makeComponent("model","YAKE_MODEL_EXPORTS")
-package.guid = "14D0133E-FC8D-41a2-9B03-56DD812C0738"
+--package.guid = "14D0133E-FC8D-41a2-9B03-56DD812C0738"
addDependency("base")
addDependency("data")
addDependency("loader")
@@ -174,19 +174,19 @@
--------------------------------------
makeComponent("loader","YAKE_LOADER_EXPORTS")
-package.guid = "FB8ED003-E23E-42a2-A91F-FCDD8B895E27"
+--package.guid = "FB8ED003-E23E-42a2-A91F-FCDD8B895E27"
addDependency("base")
addDependency("data")
--------------------------------------
makeComponent("ent","YAKE_ENT_EXPORTS")
-package.guid = "4922CEAA-98D6-47d1-AD03-A13C43229F99"
+--package.guid = "4922CEAA-98D6-47d1-AD03-A13C43229F99"
addDependency("base")
addDependency("model")
--------------------------------------
makeComponent("res","YAKE_RES_EXPORTS")
-package.guid = "DC084FFA-86EE-4b1a-99AE-70E1C5BE31D7"
+--package.guid = "DC084FFA-86EE-4b1a-99AE-70E1C5BE31D7"
addDependency("base")
--------------------------------------
@@ -195,38 +195,13 @@
-- For Linux/GCC: Do not create project.
if windows then
makeComponent("net2","YAKE_NET_EXPORTS")
- package.guid = "15A6BBC2-9018-454a-BF31-ECEED3A63CAE"
+ --package.guid = "15A6BBC2-9018-454a-BF31-ECEED3A63CAE"
--addDependency("base") -- for logging
end
--------------------------------------
-makeComponent("net","YAKE_NET_EXPORTS")
-package.guid = "ED6E596B-FCE3-4482-8D72-E11C5C72D28A"
-addDependency("base")
-
--- Yes, we compile ENet into yake::net therefore include the sources:
-addMatching("dependencies/enet/*.c")
-addMatching("dependencies/enet/include/*.h")
-
-useDep("enet") -- adds include paths, libs...
-
---------------------------------------
-makeComponent("netsvc","YAKE_NETSVC_EXPORTS")
-package.guid = "82303998-76E3-4d45-A477-B43DA4621E36"
-addDependency("base")
-addDependency("net")
-
---------------------------------------
-makeComponent("netrepsvc","YAKE_NETREPSVC_EXPORTS")
-package.guid = "0E1F72FD-B2E2-4506-A9BC-275A7106F2F3"
-addDependency("base")
-addDependency("ent")
-addDependency("net")
-addDependency("netsvc")
-
---------------------------------------
makeComponent("gui2","YAKE_GUI_EXPORTS")
-package.guid = "BE7B5C3C-4D88-4b2a-9BE0-975920DF10F0"
+--package.guid = "BE7B5C3C-4D88-4b2a-9BE0-975920DF10F0"
addDependency("base")
addDependency("res")
addDependency("scripting")
@@ -240,7 +215,7 @@
--------------------------------------
makeComponent("vehicle","YAKE_VEHICLE_EXPORTS")
-package.guid = "6A263623-F10C-4ad7-9397-119EDC53A79B"
+--package.guid = "6A263623-F10C-4ad7-9397-119EDC53A79B"
addDefine(PLUGIN_PHYSICS_ODE_REAL)
addDependency("base")
addDependency("data")
@@ -253,7 +228,7 @@
--------------------------------------
makeComponent("raf","YAKE_RAF_EXPORTS")
-package.guid = "B1B4C43B-1728-4f8d-962A-46B35C860DB6"
+--package.guid = "B1B4C43B-1728-4f8d-962A-46B35C860DB6"
addDependency("base")
addDependency("res")
addDependency("audio")
@@ -275,18 +250,18 @@
--------------------------------------
makeComponent("property","YAKE_PROPERTY_EXPORTS")
-package.guid = "726EAB13-8544-44b1-8713-B3EA600FE776"
+--package.guid = "726EAB13-8544-44b1-8713-B3EA600FE776"
addDependency("base")
--------------------------------------
makeComponent("task","YAKE_TASK_EXPORTS")
-package.guid = "9D0F5EF6-579A-48de-8C18-5608CF35824C"
+--package.guid = "9D0F5EF6-579A-48de-8C18-5608CF35824C"
addDependency("base")
--------------------------------------
if LUA_BINDINGS then
makeComponent("bindings.lua","YAKE_BINDINGS_LUA_EXPORTS")
- package.guid = "6FF27D76-E3C9-48fd-A855-BEF5CBED5C68"
+ --package.guid = "6FF27D76-E3C9-48fd-A855-BEF5CBED5C68"
addDependency("base")
addDependency("scripting")
addDependency("scriptingLua")
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <psy...@us...> - 2009-02-23 15:46:16
|
Revision: 1964
http://yake.svn.sourceforge.net/yake/?rev=1964&view=rev
Author: psyclonist
Date: 2009-02-23 15:46:09 +0000 (Mon, 23 Feb 2009)
Log Message:
-----------
build: added missing reference to dependency
Modified Paths:
--------------
trunk/yake/scripts/premake/yake.lua
Modified: trunk/yake/scripts/premake/yake.lua
===================================================================
--- trunk/yake/scripts/premake/yake.lua 2009-02-23 15:37:18 UTC (rev 1963)
+++ trunk/yake/scripts/premake/yake.lua 2009-02-23 15:46:09 UTC (rev 1964)
@@ -305,6 +305,7 @@
end
if ENABLE_LUA_GRAPHICS_OGRE then
addDependency("graphicsOgre")
+ useDep("ogre")
end
if ENABLE_LUA_PHYSICS then
addDependency("physics")
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <psy...@us...> - 2009-02-23 15:37:22
|
Revision: 1963
http://yake.svn.sourceforge.net/yake/?rev=1963&view=rev
Author: psyclonist
Date: 2009-02-23 15:37:18 +0000 (Mon, 23 Feb 2009)
Log Message:
-----------
yakePrerequisites.h: define NOMINMAX only if it hasn't been defined yet (e.g. via command-line)
Modified Paths:
--------------
trunk/yake/yake/base/yakePrerequisites.h
Modified: trunk/yake/yake/base/yakePrerequisites.h
===================================================================
--- trunk/yake/yake/base/yakePrerequisites.h 2009-02-23 15:35:00 UTC (rev 1962)
+++ trunk/yake/yake/base/yakePrerequisites.h 2009-02-23 15:37:18 UTC (rev 1963)
@@ -35,7 +35,7 @@
#include <yake/base/yakePlatform.h>
// Make sure we don't get the min and max macros on Windows. They're defined in windef.h.
-#if (YAKE_PLATFORM == PLATFORM_WIN32)
+#if (YAKE_PLATFORM == PLATFORM_WIN32) && !defined(NOMINMAX)
# define NOMINMAX
#endif
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|