File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -19,8 +19,9 @@ if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME)
1919 if (IOC_BUILD_EXAMPLES)
2020 add_subdirectory (examples/dao )
2121 add_subdirectory (examples/services )
22+ add_subdirectory (examples/basic )
2223
23- add_executable (IOC_example main.cpp
24+ add_executable (IOC_example examples/basic/ main.cpp
2425 examples/domain/employee.cpp examples/domain/employee.h
2526 examples/domain/department.cpp examples/domain/department.h
2627 examples/utils/enumerable.cpp examples/utils/enumerable.h
Original file line number Diff line number Diff line change 1+ cmake_minimum_required (VERSION 3.24.1 )
2+ project (IOC)
3+
4+ set (CMAKE_CXX_STANDARD 20)
5+
6+ # This is a placeholder CMakeLists.txt for the basic example
7+ # The main.cpp example is built in the root CMakeLists.txt
Original file line number Diff line number Diff line change 1+ # Basic Example
2+
3+ This directory contains a simple example demonstrating the usage of the IOC library.
4+
5+ ## Files
6+
7+ - ` main.cpp ` - Basic example code showing how to use the IOC dependency injection system
8+ - ` CMakeLists.txt ` - Build configuration (placeholder, the example is built from the root CMakeLists.txt)
9+
10+ ## Running the Example
11+
12+ To build and run this example:
13+
14+ 1 . From the repository root, build with examples enabled:
15+ ``` bash
16+ mkdir build && cd build
17+ cmake .. -DIOC_BUILD_EXAMPLES=ON
18+ make
19+ ```
20+
21+ 2 . Run the example:
22+ ``` bash
23+ ./IOC_example
24+ ```
25+
26+ The example demonstrates the dependency injection container managing employee and department services with logging and database access.
Original file line number Diff line number Diff line change 1- #include " examples /service.h"
1+ #include " .. /service.h"
22
33class Automobile {
44public:
You can’t perform that action at this time.
0 commit comments