Skip to content

Commit 0a14e31

Browse files
committed
update doc and readme
1 parent 3f715df commit 0a14e31

File tree

5 files changed

+41
-25
lines changed

5 files changed

+41
-25
lines changed

.github/workflows/DevCI.yml

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,8 @@ on:
66
paths-ignore:
77
- "Docs/**"
88
- ".readthedocs.yaml"
9-
- "Readme.md"
10-
pull_request:
11-
branches: ["dev"]
12-
paths-ignore:
13-
- "Docs/**"
14-
- ".readthedocs.yaml"
15-
- "Readme.md"
9+
- "README.md"
10+
1611
env:
1712
BUILD_TYPE: Release
1813
BUILD_DIR: ${{github.workspace}}/build

.github/workflows/MainCI.yml

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,12 @@
11
name: MainCI
22

33
on:
4-
push:
5-
branches: ["main"]
6-
paths-ignore:
7-
- "Docs/**"
8-
- ".readthedocs.yaml"
9-
- "Readme.md"
104
pull_request:
115
branches: ["main"]
126
paths-ignore:
137
- "Docs/**"
148
- ".readthedocs.yaml"
15-
- "Readme.md"
9+
- "README.md"
1610

1711
env:
1812
BUILD_TYPE: Release

Include/SevenBit/DI/IServiceInstance.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ namespace sb::di
3737
* @warning Using this method might couse memory leaks, client is responsible for managing this pointner
3838
* lifetime, the best approach is to imediatly wrap this poinrner with proper std::unique_ptr<T>
3939
* @code {.cpp}
40-
* std::unique_ptr<T> service{static_cast<T *>(moveOut())};
40+
* std::unique_ptr<T> service{static_cast<T *>(instance->moveOut())};
4141
* @endcode
4242
*/
4343
[[nodiscard]] virtual void *moveOut() = 0;
@@ -50,7 +50,7 @@ namespace sb::di
5050
* @warning Using this method might couse memory leaks, clietn is responsible for managing this pointner
5151
* lifetime, the best approach is to imediatly wrap this poinrner with proper std::unique_ptr<T>
5252
* @code {.cpp}
53-
* std::unique_ptr<T> service{moveOutAs<T>()};
53+
* std::unique_ptr<T> service{instance->moveOutAs<T>()};
5454
* @endcode
5555
*/
5656
template <class T> [[nodiscard]] T *moveOutAs() { return static_cast<T *>(moveOut()); };

Include/SevenBit/DI/ServiceCollection.hpp

Lines changed: 34 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -173,20 +173,26 @@ namespace sb::di
173173

174174
/**
175175
* @brief Cheks if contains descriptor matching requirement
176-
* @details descriptor.getServiceTypeId() == typeid(TService)
176+
* @code {.cpp}
177+
* descriptor.getServiceTypeId() == typeid(TService)
178+
* @endcode
177179
*/
178180
template <class TService> bool contains() const { return contains(typeid(TService)); }
179181

180182
/**
181183
* @brief Cheks if contains descriptor matching requirement
182-
* @details descriptor.getServiceTypeId() == serviceTypeId
184+
* @code {.cpp}
185+
* descriptor.getServiceTypeId() == serviceTypeId
186+
* @endcode
183187
*/
184188
bool contains(TypeId serviceTypeId) const;
185189

186190
/**
187191
* @brief Cheks if contains descriptor matching requirement
188-
* @details descriptor.getImplementationTypeId() == typeid(TImplementation) && descriptor.getServiceTypeId() ==
192+
* @code {.cpp}
193+
* descriptor.getImplementationTypeId() == typeid(TImplementation) && descriptor.getServiceTypeId() ==
189194
* typeid(TService)
195+
* @endcode
190196
*/
191197
template <class TService, class TImplementation = TService> bool containsExact() const
192198
{
@@ -195,13 +201,16 @@ namespace sb::di
195201

196202
/**
197203
* @brief Cheks if contains descriptor matching requirement
198-
* @details descriptor.getImplementationTypeId() == implementationTypeId && descriptor.getServiceTypeId() ==
204+
* @code {.cpp}
205+
* descriptor.getImplementationTypeId() == implementationTypeId && descriptor.getServiceTypeId() ==
206+
* @endcode
199207
* serviceTypeId
200208
*/
201209
bool containsExact(TypeId serviceTypeId, TypeId implementationTypeId) const;
202210

203211
/**
204212
* @brief Inserts descriptor before giver iterator
213+
* @details Returns iterator pointing to the inserted
205214
*/
206215
Iterator insert(ConstIterator pos, ServiceDescriptor descriptor);
207216

@@ -217,25 +226,30 @@ namespace sb::di
217226

218227
/**
219228
* @brief Removes descriptor with given iterator
229+
* @details Returns iterator following the last removed element
220230
*/
221231
Iterator remove(Iterator pos);
222232
/**
223233
* @brief Removes descriptor with given iterator
234+
* @details Returns iterator following the last removed element
224235
*/
225236
Iterator remove(ConstIterator pos);
226237

227238
/**
228239
* @brief Removes descriptors between given iterators
240+
* @details Returns iterator following the last removed element
229241
*/
230242
Iterator removeRange(Iterator begin, Iterator end);
231243
/**
232244
* @brief Removes descriptors between given iterators
245+
* @details Returns iterator following the last removed element
233246
*/
234247
Iterator removeRange(ConstIterator begin, ConstIterator end);
235248

236249
/**
237250
* @brief Removes all descriptors meeting TPred requirement
238251
* @tparam TPred is functor with this sheme: (const ServiceDescriptor&) -> bool
252+
* @details Returns number of removed elements
239253
*/
240254
template <class TPred> size_t removeIf(const TPred &pred)
241255
{
@@ -247,20 +261,29 @@ namespace sb::di
247261

248262
/**
249263
* @brief Removes all descriptors meeting requirement
250-
* @details descriptor.getServiceTypeId() == typeid(TService)
264+
* @code {.cpp}
265+
* descriptor.getServiceTypeId() == typeid(TService)
266+
* @endcode
267+
* @details Returns number of removed elements
251268
*/
252269
template <class TService> size_t removeAll() { return removeAll(typeid(TService)); }
253270

254271
/**
255272
* @brief Removes all descriptors meeting requirement
256-
* @details descriptor.getServiceTypeId() == serviceTypeId
273+
* @code {.cpp}
274+
* descriptor.getServiceTypeId() == serviceTypeId
275+
* @endcode
276+
* @details Returns number of removed elements
257277
*/
258278
size_t removeAll(TypeId serviceTypeId);
259279

260280
/**
261281
* @brief Removes all descriptors meeting requirement
262-
* @details descriptor.getImplementationTypeId() == typeid(TImplementation) && descriptor.getServiceTypeId() ==
282+
* @code {.cpp}
283+
* descriptor.getImplementationTypeId() == typeid(TImplementation) && descriptor.getServiceTypeId() ==
263284
* typeid(TService)
285+
* @endcode
286+
* @details Returns number of removed elements
264287
*/
265288
template <class TService, class TImplementation = TService> size_t remove()
266289
{
@@ -269,8 +292,11 @@ namespace sb::di
269292

270293
/**
271294
* @brief Removes all descriptors meeting requirement
272-
* @details descriptor.getImplementationTypeId() == implementationTypeId && descriptor.getServiceTypeId() ==
295+
* @code {.cpp}
296+
* descriptor.getImplementationTypeId() == implementationTypeId && descriptor.getServiceTypeId() ==
273297
* serviceTypeId
298+
* @endcode
299+
* @details Returns number of removed elements
274300
*/
275301
size_t remove(TypeId serviceTypeId, TypeId implementationTypeId);
276302

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,8 @@ Output
8989
actionA, actionB executed.
9090
```
9191

92-
More examples and tutorials are available on the [Documentation & Examples]([#](https://7bitinjector.readthedocs.io/en/latest/index.html)) page
92+
More examples and tutorials are available on the
93+
[Documentation & Examples](https://7bitinjector.readthedocs.io/en/latest/index.html) page
9394

9495
@7bitcoder Sylwester Dawida 2023
9596

0 commit comments

Comments
 (0)