Skip to content

Commit 2c1381a

Browse files
committed
Updated to latest oatpp APIs
1 parent 39bcb4a commit 2c1381a

File tree

7 files changed

+13
-60
lines changed

7 files changed

+13
-60
lines changed

main/CMakeLists.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@ set(CMAKE_CXX_STANDARD 11)
88

99
add_library(${project_name}-lib
1010
src/AppComponent.hpp
11-
src/Logger.hpp
12-
src/Logger.cpp
11+
src/controller/MyController.cpp
1312
src/controller/MyController.hpp
1413
src/dto/MyDTOs.hpp
1514
)

main/src/App.cpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88

99
#include "./controller/MyController.hpp"
1010
#include "./AppComponent.hpp"
11-
#include "./Logger.hpp"
1211

1312
#include "oatpp/network/server/Server.hpp"
1413

@@ -46,14 +45,11 @@ void run() {
4645
* main
4746
*/
4847
int main(int argc, const char * argv[]) {
49-
50-
oatpp::base::Environment::setLogger(new Logger());
48+
5149
oatpp::base::Environment::init();
5250

5351
run();
5452

55-
oatpp::base::Environment::setLogger(nullptr); ///< free Logger
56-
5753
/* Print how much objects were created during app running, and what have left-probably leaked */
5854
/* Disable object counting for release builds using '-D OATPP_DISABLE_ENV_OBJECT_COUNTERS' flag for better performance */
5955
std::cout << "\nEnvironment:\n";

main/src/AppComponent.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ class AppComponent {
2929
*/
3030
OATPP_CREATE_COMPONENT(std::shared_ptr<oatpp::async::Executor>, executor)([] {
3131
return std::make_shared<oatpp::async::Executor>(
32-
4 /* Data-Processing threads */,
33-
1 /* I/O threads */,
32+
9 /* Data-Processing threads */,
33+
2 /* I/O threads */,
3434
1 /* Timer threads */
3535
);
3636
}());

main/src/Logger.cpp

Lines changed: 0 additions & 16 deletions
This file was deleted.

main/src/Logger.hpp

Lines changed: 0 additions & 29 deletions
This file was deleted.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
//
2+
// Created by Leonid on 2019-05-27.
3+
//
4+
5+
#include "MyController.hpp"
6+
7+
// TODO some code here

main/test/tests.cpp

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11

2-
#include "Logger.hpp"
3-
42
#include "oatpp-test/UnitTest.hpp"
53
#include <iostream>
64

@@ -26,13 +24,9 @@ void runTests() {
2624
int main() {
2725

2826
oatpp::base::Environment::init();
29-
oatpp::base::Environment::setLogger(new Logger());
3027

3128
runTests();
3229

33-
oatpp::base::Environment::setLogger(nullptr);
34-
oatpp::base::Environment::destroy();
35-
3630
/* Print how much objects were created during app running, and what have left-probably leaked */
3731
/* Disable object counting for release builds using '-D OATPP_DISABLE_ENV_OBJECT_COUNTERS' flag for better performance */
3832
std::cout << "\nEnvironment:\n";
@@ -41,5 +35,7 @@ int main() {
4135

4236
OATPP_ASSERT(oatpp::base::Environment::getObjectsCount() == 0);
4337

38+
oatpp::base::Environment::destroy();
39+
4440
return 0;
4541
}

0 commit comments

Comments
 (0)