@@ -65,42 +65,17 @@ class Blackboard
6565
6666 [[nodiscard]] const Entry* getEntry (const std::string& key) const ;
6767
68- [[nodiscard]] Entry* getEntry (const std::string& key)
69- {
70- // "Avoid Duplication in const and Non-const Member Function,"
71- // on p. 23, in Item 3 "Use const whenever possible," in Effective C++, 3d ed
72- return const_cast <Entry*>( static_cast <const Blackboard &>(*this ).getEntry (key));
73- }
68+ [[nodiscard]] Entry* getEntry (const std::string& key);
7469
75- [[nodiscard]] AnyPtrLocked getAnyLocked (const std::string& key)
76- {
77- if (auto entry = getEntry (key))
78- {
79- return AnyPtrLocked (&entry->value , &entry->entry_mutex );
80- }
81- return {};
82- }
70+ [[nodiscard]] AnyPtrLocked getAnyLocked (const std::string& key);
8371
84- [[nodiscard]] AnyPtrLocked getAnyLocked (const std::string& key) const
85- {
86- if (auto entry = getEntry (key))
87- {
88- return AnyPtrLocked (&entry->value , const_cast <std::mutex*>(&entry->entry_mutex ));
89- }
90- return {};
91- }
72+ [[nodiscard]] AnyPtrLocked getAnyLocked (const std::string& key) const ;
9273
9374 [[deprecated(" Use getAnyLocked instead" )]]
94- const Any* getAny (const std::string& key) const
95- {
96- return getAnyLocked (key).get ();
97- }
75+ const Any* getAny (const std::string& key) const ;
9876
9977 [[deprecated(" Use getAnyLocked instead" )]]
100- Any* getAny (const std::string& key)
101- {
102- return const_cast <Any*>(getAnyLocked (key).get ());
103- }
78+ Any* getAny (const std::string& key);
10479
10580 /* * Return true if the entry with the given key was found.
10681 * Note that this method may throw an exception if the cast to T failed.
@@ -218,22 +193,12 @@ class Blackboard
218193
219194 [[nodiscard]] std::vector<StringView> getKeys () const ;
220195
221- void clear ()
222- {
223- std::unique_lock<std::mutex> lock (mutex_);
224- storage_.clear ();
225- }
196+ void clear ();
226197
227198 [[deprecated(" Use getAnyLocked to access safely an Entry" )]]
228- std::recursive_mutex& entryMutex () const
229- {
230- return entry_mutex_;
231- }
199+ std::recursive_mutex& entryMutex () const ;
232200
233- void createEntry (const std::string& key, const PortInfo& info)
234- {
235- createEntryImpl (key, info);
236- }
201+ void createEntry (const std::string& key, const PortInfo& info);
237202
238203private:
239204 mutable std::mutex mutex_;
0 commit comments