Просмотр исходного кода

原来的Egametang目录改成Platform目录,Platform目录和Game统一在
Egametang目录之下

tanghai 14 лет назад
Родитель
Сommit
0dd20946ee
73 измененных файлов с 7 добавлено и 128 удалено
  1. 3 3
      Egametang/CMakeLists.txt
  2. 0 0
      Egametang/Cmake/FindGFlags.cmake
  3. 0 0
      Egametang/Cmake/FindGLog.cmake
  4. 0 0
      Egametang/Cmake/FindGMock.cmake
  5. 0 0
      Egametang/Cmake/FindGTest.cmake
  6. 0 0
      Egametang/Cmake/FindPerftools.cmake
  7. 0 0
      Egametang/Game/CMakeLists.txt
  8. 0 0
      Egametang/Game/Event/ActionIf.h
  9. 0 0
      Egametang/Game/Event/AndNode.cc
  10. 0 0
      Egametang/Game/Event/AndNode.h
  11. 3 4
      Egametang/Game/Event/BuffTypeCondition.cc
  12. 0 0
      Egametang/Game/Event/BuffTypeCondition.h
  13. 0 0
      Egametang/Game/Event/CMakeLists.txt
  14. 0 0
      Egametang/Game/Event/ConditionFactory.cc
  15. 0 0
      Egametang/Game/Event/ConditionFactory.h
  16. 0 0
      Egametang/Game/Event/DotFirstDamage.txt
  17. 0 0
      Egametang/Game/Event/Event.cc
  18. 0 0
      Egametang/Game/Event/Event.h
  19. 0 0
      Egametang/Game/Event/EventConf.proto
  20. 0 0
      Egametang/Game/Event/GameEvents.cc
  21. 0 0
      Egametang/Game/Event/GameEvents.h
  22. 0 0
      Egametang/Game/Event/NodeFactories.cc
  23. 0 0
      Egametang/Game/Event/NodeFactories.h
  24. 0 0
      Egametang/Game/Event/NodeIf.h
  25. 0 0
      Egametang/Game/Event/NotNode.cc
  26. 0 0
      Egametang/Game/Event/NotNode.h
  27. 0 0
      Egametang/Game/Event/OrNode.cc
  28. 0 0
      Egametang/Game/Event/OrNode.h
  29. 0 0
      Egametang/Platform/Base/Marcos.h
  30. 0 0
      Egametang/Platform/Base/Typedef.h
  31. 0 0
      Egametang/Platform/CMakeLists.txt
  32. 0 0
      Egametang/Platform/Python/CMakeLists.txt
  33. 0 0
      Egametang/Platform/Python/PythonInit.cc
  34. 0 0
      Egametang/Platform/Python/PythonInit.h
  35. 0 0
      Egametang/Platform/Python/PythonInitTest.cc
  36. 0 0
      Egametang/Platform/Python/PythonInterpreter.cc
  37. 0 0
      Egametang/Platform/Python/PythonInterpreter.h
  38. 1 1
      Egametang/Platform/Python/PythonInterpreterTest.cc
  39. 0 0
      Egametang/Platform/Python/PythonInterpreterTest.py
  40. 0 0
      Egametang/Platform/Rpc/CMakeLists.txt
  41. 0 0
      Egametang/Platform/Rpc/Echo.proto
  42. 0 0
      Egametang/Platform/Rpc/MethodInfo.h
  43. 0 0
      Egametang/Platform/Rpc/RequestHandler.cc
  44. 0 0
      Egametang/Platform/Rpc/RequestHandler.h
  45. 0 0
      Egametang/Platform/Rpc/ResponseHandler.cc
  46. 0 0
      Egametang/Platform/Rpc/ResponseHandler.h
  47. 0 0
      Egametang/Platform/Rpc/RpcChannel.cc
  48. 0 0
      Egametang/Platform/Rpc/RpcChannel.h
  49. 0 0
      Egametang/Platform/Rpc/RpcChannelTest.cc
  50. 0 0
      Egametang/Platform/Rpc/RpcCommunicator.cc
  51. 0 0
      Egametang/Platform/Rpc/RpcCommunicator.h
  52. 0 0
      Egametang/Platform/Rpc/RpcCommunicatorTest.cc
  53. 0 0
      Egametang/Platform/Rpc/RpcController.cc
  54. 0 0
      Egametang/Platform/Rpc/RpcController.h
  55. 0 0
      Egametang/Platform/Rpc/RpcServer.cc
  56. 0 0
      Egametang/Platform/Rpc/RpcServer.h
  57. 0 0
      Egametang/Platform/Rpc/RpcServerMock.h
  58. 0 0
      Egametang/Platform/Rpc/RpcServerTest.cc
  59. 0 0
      Egametang/Platform/Rpc/RpcSession.cc
  60. 0 0
      Egametang/Platform/Rpc/RpcSession.h
  61. 0 0
      Egametang/Platform/Rpc/RpcSessionTest.cc
  62. 0 0
      Egametang/Platform/Rpc/RpcTypedef.h
  63. 0 0
      Egametang/Platform/Thread/CMakeLists.txt
  64. 0 0
      Egametang/Platform/Thread/CountBarrier.cc
  65. 0 0
      Egametang/Platform/Thread/CountBarrier.h
  66. 0 0
      Egametang/Platform/Thread/CountBarrierTest.cc
  67. 0 0
      Egametang/Platform/Thread/ThreadPool.cc
  68. 0 0
      Egametang/Platform/Thread/ThreadPool.h
  69. 0 0
      Egametang/Platform/Thread/ThreadPoolMock.h
  70. 0 0
      Egametang/Platform/Thread/ThreadPoolTest.cc
  71. 0 0
      Egametang/Platform/Thread/ThreadTypedef.h
  72. 0 67
      Src/Experimental/BoostAsioTest.cc
  73. 0 53
      Src/Experimental/BoostFunctionTest.cc

+ 3 - 3
Src/CMakeLists.txt → Egametang/CMakeLists.txt

@@ -13,8 +13,8 @@ IF(BUILD_TESTS)
 	ENABLE_TESTING()
 ENDIF()
 
-INCLUDE_DIRECTORIES(Egametang)
-INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}/Egametang)
+INCLUDE_DIRECTORIES(Platform)
+INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}/Platform)
 
 FIND_PACKAGE(GFlags REQUIRED)
 INCLUDE_DIRECTORIES(${GFLAGS_INCLUDE_DIR})
@@ -53,5 +53,5 @@ set(ThirdPartyLibs
 	${PERFTOOLS_DEBUG_LIBRARIES}
 )
 
-ADD_SUBDIRECTORY(Egametang)
+ADD_SUBDIRECTORY(Platform)
 ADD_SUBDIRECTORY(Game)

+ 0 - 0
Src/Cmake/FindGFlags.cmake → Egametang/Cmake/FindGFlags.cmake


+ 0 - 0
Src/Cmake/FindGLog.cmake → Egametang/Cmake/FindGLog.cmake


+ 0 - 0
Src/Cmake/FindGMock.cmake → Egametang/Cmake/FindGMock.cmake


+ 0 - 0
Src/Cmake/FindGTest.cmake → Egametang/Cmake/FindGTest.cmake


+ 0 - 0
Src/Cmake/FindPerftools.cmake → Egametang/Cmake/FindPerftools.cmake


+ 0 - 0
Src/Game/CMakeLists.txt → Egametang/Game/CMakeLists.txt


+ 0 - 0
Src/Game/Event/ActionIf.h → Egametang/Game/Event/ActionIf.h


+ 0 - 0
Src/Game/Event/AndNode.cc → Egametang/Game/Event/AndNode.cc


+ 0 - 0
Src/Game/Event/AndNode.h → Egametang/Game/Event/AndNode.h


+ 3 - 4
Src/Game/Event/BuffTypeCondition.cc → Egametang/Game/Event/BuffTypeCondition.cc

@@ -1,8 +1,7 @@
-#include <boost/foreach.hpp>
-#include "Base/Marcos.h"
 #include "Event/BuffTypeCondition.h"
 
-namespace Egametang {
+namespace Egametang {
+
 BuffType::BuffType(int buff_type): buff_type(buff_type)
 {
 }
@@ -12,7 +11,7 @@ bool BuffType::Check(ContexIf* contex)
 	return true;
 }
 
-Egametang::BuffTypeFactory::~BuffTypeFactory()
+BuffTypeFactory::~BuffTypeFactory()
 {
 }
 

+ 0 - 0
Src/Game/Event/BuffTypeCondition.h → Egametang/Game/Event/BuffTypeCondition.h


+ 0 - 0
Src/Game/Event/CMakeLists.txt → Egametang/Game/Event/CMakeLists.txt


+ 0 - 0
Src/Game/Event/ConditionFactory.cc → Egametang/Game/Event/ConditionFactory.cc


+ 0 - 0
Src/Game/Event/ConditionFactory.h → Egametang/Game/Event/ConditionFactory.h


+ 0 - 0
Src/Game/Event/DotFirstDamage.txt → Egametang/Game/Event/DotFirstDamage.txt


+ 0 - 0
Src/Game/Event/Event.cc → Egametang/Game/Event/Event.cc


+ 0 - 0
Src/Game/Event/Event.h → Egametang/Game/Event/Event.h


+ 0 - 0
Src/Game/Event/EventConf.proto → Egametang/Game/Event/EventConf.proto


+ 0 - 0
Src/Game/Event/GameEvents.cc → Egametang/Game/Event/GameEvents.cc


+ 0 - 0
Src/Game/Event/GameEvents.h → Egametang/Game/Event/GameEvents.h


+ 0 - 0
Src/Game/Event/NodeFactories.cc → Egametang/Game/Event/NodeFactories.cc


+ 0 - 0
Src/Game/Event/NodeFactories.h → Egametang/Game/Event/NodeFactories.h


+ 0 - 0
Src/Game/Event/NodeIf.h → Egametang/Game/Event/NodeIf.h


+ 0 - 0
Src/Game/Event/NotNode.cc → Egametang/Game/Event/NotNode.cc


+ 0 - 0
Src/Game/Event/NotNode.h → Egametang/Game/Event/NotNode.h


+ 0 - 0
Src/Game/Event/OrNode.cc → Egametang/Game/Event/OrNode.cc


+ 0 - 0
Src/Game/Event/OrNode.h → Egametang/Game/Event/OrNode.h


+ 0 - 0
Src/Egametang/Base/Marcos.h → Egametang/Platform/Base/Marcos.h


+ 0 - 0
Src/Egametang/Base/Typedef.h → Egametang/Platform/Base/Typedef.h


+ 0 - 0
Src/Egametang/CMakeLists.txt → Egametang/Platform/CMakeLists.txt


+ 0 - 0
Src/Egametang/Python/CMakeLists.txt → Egametang/Platform/Python/CMakeLists.txt


+ 0 - 0
Src/Egametang/Python/PythonInit.cc → Egametang/Platform/Python/PythonInit.cc


+ 0 - 0
Src/Egametang/Python/PythonInit.h → Egametang/Platform/Python/PythonInit.h


+ 0 - 0
Src/Egametang/Python/PythonInitTest.cc → Egametang/Platform/Python/PythonInitTest.cc


+ 0 - 0
Src/Egametang/Python/PythonInterpreter.cc → Egametang/Platform/Python/PythonInterpreter.cc


+ 0 - 0
Src/Egametang/Python/PythonInterpreter.h → Egametang/Platform/Python/PythonInterpreter.h


+ 1 - 1
Src/Egametang/Python/PythonInterpreterTest.cc → Egametang/Platform/Python/PythonInterpreterTest.cc

@@ -68,7 +68,7 @@ BOOST_PYTHON_MODULE(PersonTest)
 TEST_F(PythonInterpreterTest, EnterPythonScript)
 {
 	initPersonTest();
-	interpreter.ImportPath("../../../Src/Egametang/Python/");
+	interpreter.ImportPath("../../../Egametang/Platform/Python/");
 	interpreter.ImportModule("PythonInterpreterTest");
 
 	PersonTestPtr person(new PersonTest);

+ 0 - 0
Src/Egametang/Python/PythonInterpreterTest.py → Egametang/Platform/Python/PythonInterpreterTest.py


+ 0 - 0
Src/Egametang/Rpc/CMakeLists.txt → Egametang/Platform/Rpc/CMakeLists.txt


+ 0 - 0
Src/Egametang/Rpc/Echo.proto → Egametang/Platform/Rpc/Echo.proto


+ 0 - 0
Src/Egametang/Rpc/MethodInfo.h → Egametang/Platform/Rpc/MethodInfo.h


+ 0 - 0
Src/Egametang/Rpc/RequestHandler.cc → Egametang/Platform/Rpc/RequestHandler.cc


+ 0 - 0
Src/Egametang/Rpc/RequestHandler.h → Egametang/Platform/Rpc/RequestHandler.h


+ 0 - 0
Src/Egametang/Rpc/ResponseHandler.cc → Egametang/Platform/Rpc/ResponseHandler.cc


+ 0 - 0
Src/Egametang/Rpc/ResponseHandler.h → Egametang/Platform/Rpc/ResponseHandler.h


+ 0 - 0
Src/Egametang/Rpc/RpcChannel.cc → Egametang/Platform/Rpc/RpcChannel.cc


+ 0 - 0
Src/Egametang/Rpc/RpcChannel.h → Egametang/Platform/Rpc/RpcChannel.h


+ 0 - 0
Src/Egametang/Rpc/RpcChannelTest.cc → Egametang/Platform/Rpc/RpcChannelTest.cc


+ 0 - 0
Src/Egametang/Rpc/RpcCommunicator.cc → Egametang/Platform/Rpc/RpcCommunicator.cc


+ 0 - 0
Src/Egametang/Rpc/RpcCommunicator.h → Egametang/Platform/Rpc/RpcCommunicator.h


+ 0 - 0
Src/Egametang/Rpc/RpcCommunicatorTest.cc → Egametang/Platform/Rpc/RpcCommunicatorTest.cc


+ 0 - 0
Src/Egametang/Rpc/RpcController.cc → Egametang/Platform/Rpc/RpcController.cc


+ 0 - 0
Src/Egametang/Rpc/RpcController.h → Egametang/Platform/Rpc/RpcController.h


+ 0 - 0
Src/Egametang/Rpc/RpcServer.cc → Egametang/Platform/Rpc/RpcServer.cc


+ 0 - 0
Src/Egametang/Rpc/RpcServer.h → Egametang/Platform/Rpc/RpcServer.h


+ 0 - 0
Src/Egametang/Rpc/RpcServerMock.h → Egametang/Platform/Rpc/RpcServerMock.h


+ 0 - 0
Src/Egametang/Rpc/RpcServerTest.cc → Egametang/Platform/Rpc/RpcServerTest.cc


+ 0 - 0
Src/Egametang/Rpc/RpcSession.cc → Egametang/Platform/Rpc/RpcSession.cc


+ 0 - 0
Src/Egametang/Rpc/RpcSession.h → Egametang/Platform/Rpc/RpcSession.h


+ 0 - 0
Src/Egametang/Rpc/RpcSessionTest.cc → Egametang/Platform/Rpc/RpcSessionTest.cc


+ 0 - 0
Src/Egametang/Rpc/RpcTypedef.h → Egametang/Platform/Rpc/RpcTypedef.h


+ 0 - 0
Src/Egametang/Thread/CMakeLists.txt → Egametang/Platform/Thread/CMakeLists.txt


+ 0 - 0
Src/Egametang/Thread/CountBarrier.cc → Egametang/Platform/Thread/CountBarrier.cc


+ 0 - 0
Src/Egametang/Thread/CountBarrier.h → Egametang/Platform/Thread/CountBarrier.h


+ 0 - 0
Src/Egametang/Thread/CountBarrierTest.cc → Egametang/Platform/Thread/CountBarrierTest.cc


+ 0 - 0
Src/Egametang/Thread/ThreadPool.cc → Egametang/Platform/Thread/ThreadPool.cc


+ 0 - 0
Src/Egametang/Thread/ThreadPool.h → Egametang/Platform/Thread/ThreadPool.h


+ 0 - 0
Src/Egametang/Thread/ThreadPoolMock.h → Egametang/Platform/Thread/ThreadPoolMock.h


+ 0 - 0
Src/Egametang/Thread/ThreadPoolTest.cc → Egametang/Platform/Thread/ThreadPoolTest.cc


+ 0 - 0
Src/Egametang/Thread/ThreadTypedef.h → Egametang/Platform/Thread/ThreadTypedef.h


+ 0 - 67
Src/Experimental/BoostAsioTest.cc

@@ -1,67 +0,0 @@
-#include <iostream>
-#include <boost/asio.hpp>
-#include <boost/thread.hpp>
-#include <boost/bind.hpp>
-#include <boost/date_time/posix_time/posix_time.hpp>
-
-class printer
-{
-public:
-	printer(boost::asio::io_service& io) :
-		strand_(io), timer1_(io, boost::posix_time::seconds(1)), timer2_(io,
-				boost::posix_time::seconds(1)), count_(0)
-	{
-		timer1_.async_wait(strand_.wrap(boost::bind(&printer::print1, this)));
-		timer2_.async_wait(strand_.wrap(boost::bind(&printer::print2, this)));
-	}
-
-	~printer()
-	{
-		std::cout << "Final count is " << count_ << "\n";
-	}
-
-	void print1()
-	{
-		if (count_ < 10)
-		{
-			std::cout << "Timer 1: " << count_ << "\n";
-			++count_;
-
-			timer1_.expires_at(timer1_.expires_at()
-					+ boost::posix_time::seconds(1));
-			timer1_.async_wait(
-					strand_.wrap(boost::bind(&printer::print1, this)));
-		}
-	}
-
-	void print2()
-	{
-		if (count_ < 10)
-		{
-			std::cout << "Timer 2: " << count_ << "\n";
-			++count_;
-
-			timer2_.expires_at(timer2_.expires_at()
-					+ boost::posix_time::seconds(1));
-			timer2_.async_wait(
-					strand_.wrap(boost::bind(&printer::print2, this)));
-		}
-	}
-
-private:
-	boost::asio::strand strand_;
-	boost::asio::deadline_timer timer1_;
-	boost::asio::deadline_timer timer2_;
-	int count_;
-};
-
-int main()
-{
-	boost::asio::io_service io;
-	printer p(io);
-	boost::thread t(boost::bind(&boost::asio::io_service::run, &io));
-	io.run();
-	t.join();
-
-	return 0;
-}

+ 0 - 53
Src/Experimental/BoostFunctionTest.cc

@@ -1,53 +0,0 @@
-//  Created on: 2010-6-28
-//      Author: tanghai
-
-#include <boost/function.hpp>
-#include <boost/bind.hpp>
-#include <gtest/gtest.h>
-#include <gflags/gflags.h>
-#include <glog/logging.h>
-
-namespace Egametang {
-class BoostTest: public testing::Test
-{
-protected:
-	int a;
-	boost::function<int(int)> func;
-
-	void SetUp()
-	{
-		a = 6;
-	}
-public:
-	BoostTest()
-	{
-	}
-
-	virtual ~BoostTest()
-	{
-	}
-
-	int Max(int a, int b)
-	{
-		LOG(INFO) << a << " " << b;
-		return a > b? a : b;
-	}
-};
-
-TEST_F(BoostTest, Test1)
-{
-	int x = 5;
-	func = boost::bind(&BoostTest::Max, this, _1, x);
-	int b = func(a);
-	LOG(INFO) << b;
-}
-}
-
-int main(int argc, char* argv[])
-{
-	FLAGS_logtostderr = true;
-	testing::InitGoogleTest(&argc, argv);
-	google::ParseCommandLineFlags(&argc, &argv, true);
-	google::InitGoogleLogging(argv[0]);
-	return RUN_ALL_TESTS();
-}