Skip to content

Commit

Permalink
remove implicit inlines
Browse files Browse the repository at this point in the history
  • Loading branch information
sarthou committed Oct 22, 2024
1 parent 3a26bb8 commit 1aab6ab
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ namespace ontologenius {
RelationsWithInductions(const RelationsWithInductions& other) = delete;
~RelationsWithInductions() { clear(); }

inline size_t size() const { return relations.size(); }
inline bool empty() const { return relations.empty(); }
size_t size() const { return relations.size(); }
bool empty() const { return relations.empty(); }
T& operator[](size_t index) { return relations[index]; }

size_t pushBack(T& relation)
Expand Down Expand Up @@ -74,12 +74,12 @@ namespace ontologenius {
return std::find(relations.begin(), relations.end(), other);
}

inline typename std::vector<T>::iterator begin() { return relations.begin(); }
inline typename std::vector<T>::iterator end() { return relations.end(); }
inline typename std::vector<T>::const_iterator cbegin() const { return relations.cbegin(); }
inline typename std::vector<T>::const_iterator cend() const { return relations.cend(); }
inline typename std::vector<T>::reverse_iterator rbegin() { return relations.rbegin(); }
inline typename std::vector<T>::reverse_iterator rend() { return relations.rend(); }
typename std::vector<T>::iterator begin() { return relations.begin(); }
typename std::vector<T>::iterator end() { return relations.end(); }
typename std::vector<T>::const_iterator cbegin() const { return relations.cbegin(); }
typename std::vector<T>::const_iterator cend() const { return relations.cend(); }
typename std::vector<T>::reverse_iterator rbegin() { return relations.rbegin(); }
typename std::vector<T>::reverse_iterator rend() { return relations.rend(); }
};

} // namespace ontologenius
Expand Down
2 changes: 1 addition & 1 deletion include/ontologenius/core/ontoGraphs/Branchs/ValuedNode.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ namespace ontologenius {
Dictionary steady_dictionary_;

template<typename C>
inline void conditionalPushBack(std::vector<C>& vect, const C& data)
void conditionalPushBack(std::vector<C>& vect, const C& data)
{
if(std::find(vect.begin(), vect.end(), data) == vect.end())
vect.push_back(data);
Expand Down
12 changes: 6 additions & 6 deletions include/ontologenius/core/ontoGraphs/Branchs/WordTable.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,34 +18,34 @@ namespace ontologenius {
table_.emplace_back(""); // index 0 is reserved for the "no result index"
}

inline index_t add(const std::string& value)
index_t add(const std::string& value)
{
table_.push_back(value);
return (index_t)table_.size() - 1;
}

inline std::string& get(index_t index)
std::string& get(index_t index)
{
return table_[index];
}

inline std::string& operator[](index_t index)
std::string& operator[](index_t index)
{
return table_[index];
}

inline const std::string& operator[](index_t index) const
const std::string& operator[](index_t index) const
{
return table_[index];
}

inline void index2string(std::unordered_set<std::string>& res, const std::unordered_set<index_t>& base)
void index2string(std::unordered_set<std::string>& res, const std::unordered_set<index_t>& base)
{
for(index_t i : base)
res.insert(table_[i]);
}

inline size_t size() const
size_t size() const
{
return table_.size();
}
Expand Down
18 changes: 9 additions & 9 deletions include/ontologenius/core/ontoGraphs/Graphs/Graph.h
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ namespace ontologenius {
// use std::lock_guard<std::shared_timed_mutex> lock(mutex_); to WRITE A DATA
// use std::shared_lock<std::shared_timed_mutex> lock(mutex_); to READ A DATA

inline void removeFromDictionary(std::map<std::string, std::vector<std::string>>& dictionary, const std::string& lang, const std::string& word)
void removeFromDictionary(std::map<std::string, std::vector<std::string>>& dictionary, const std::string& lang, const std::string& word)
{
if(dictionary.find(lang) != dictionary.end())
{
Expand All @@ -117,7 +117,7 @@ namespace ontologenius {
}

template<class T>
inline void removeFromVect(std::vector<T>& vect, const T& value)
void removeFromVect(std::vector<T>& vect, const T& value)
{
for(size_t i = 0; i < vect.size();)
if(vect[i] == value)
Expand All @@ -127,7 +127,7 @@ namespace ontologenius {
}

template<class T>
inline void removeFromElemVect(std::vector<SingleElement<T>>& vect, const T& value)
void removeFromElemVect(std::vector<SingleElement<T>>& vect, const T& value)
{
for(size_t i = 0; i < vect.size();)
if(vect[i].elem == value)
Expand All @@ -137,7 +137,7 @@ namespace ontologenius {
}

template<class T>
inline void removeFromElemVect(RelationsWithInductions<SingleElement<T>>& vect, const T& value)
void removeFromElemVect(RelationsWithInductions<SingleElement<T>>& vect, const T& value)
{
for(size_t i = 0; i < vect.size();)
if(vect[i].elem == value)
Expand All @@ -147,7 +147,7 @@ namespace ontologenius {
}

template<typename T>
inline void getInMap(T** ptr, const std::string& name, std::map<std::string, T*>& map)
void getInMap(T** ptr, const std::string& name, std::map<std::string, T*>& map)
{
if(*ptr != nullptr)
return;
Expand All @@ -158,7 +158,7 @@ namespace ontologenius {
}

template<typename C>
inline bool conditionalPushBack(std::vector<C>& vect, const C& data)
bool conditionalPushBack(std::vector<C>& vect, const C& data)
{
if(std::find(vect.begin(), vect.end(), data) == vect.end())
{
Expand All @@ -170,7 +170,7 @@ namespace ontologenius {
}

template<typename C>
inline bool conditionalPushBack(RelationsWithInductions<C>& vect, const C& data)
bool conditionalPushBack(RelationsWithInductions<C>& vect, const C& data)
{
if(std::find(vect.begin(), vect.end(), data) == vect.end())
{
Expand All @@ -182,7 +182,7 @@ namespace ontologenius {
}

template<typename C>
inline bool conditionalPushBack(std::vector<SingleElement<C>>& vect, const SingleElement<C>& data)
bool conditionalPushBack(std::vector<SingleElement<C>>& vect, const SingleElement<C>& data)
{
auto it = std::find(vect.begin(), vect.end(), data);
if(it == vect.end())
Expand All @@ -197,7 +197,7 @@ namespace ontologenius {
}

template<typename C>
inline bool conditionalPushBack(RelationsWithInductions<SingleElement<C>>& vect, const SingleElement<C>& data)
bool conditionalPushBack(RelationsWithInductions<SingleElement<C>>& vect, const SingleElement<C>& data)
{
auto it = std::find(vect.begin(), vect.end(), data);
if(it == vect.end())
Expand Down

0 comments on commit 1aab6ab

Please sign in to comment.