Merge pull request #5897 from Icinga/remove-inline

Remove unnecessary inline statements
This commit is contained in:
Gunnar Beutner 2017-12-20 14:14:31 +01:00 committed by GitHub
commit df88da5836
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
11 changed files with 103 additions and 103 deletions

View File

@ -47,14 +47,14 @@ public:
typedef std::vector<Value>::size_type SizeType;
inline Array(void)
Array(void)
{ }
inline Array(std::initializer_list<Value> init)
Array(std::initializer_list<Value> init)
: m_Data(init)
{ }
inline ~Array(void)
~Array(void)
{ }
Value Get(SizeType index) const;
@ -70,7 +70,7 @@ public:
*
* @returns An iterator.
*/
inline Iterator Begin(void)
Iterator Begin(void)
{
ASSERT(OwnsLock());
@ -84,7 +84,7 @@ public:
*
* @returns An iterator.
*/
inline Iterator End(void)
Iterator End(void)
{
ASSERT(OwnsLock());

View File

@ -59,17 +59,17 @@ public:
}
}
static inline long ToLong(const Value& val)
static long ToLong(const Value& val)
{
return val;
}
static inline double ToDouble(const Value& val)
static double ToDouble(const Value& val)
{
return val;
}
static inline bool ToBool(const Value& val)
static bool ToBool(const Value& val)
{
return val.ToBool();
}

View File

@ -49,10 +49,10 @@ public:
typedef std::map<String, Value>::value_type Pair;
inline Dictionary(void)
Dictionary(void)
{ }
inline ~Dictionary(void)
~Dictionary(void)
{ }
Value Get(const String& key) const;
@ -68,7 +68,7 @@ public:
*
* @returns An iterator.
*/
inline Iterator Begin(void)
Iterator Begin(void)
{
ASSERT(OwnsLock());
@ -82,7 +82,7 @@ public:
*
* @returns An iterator.
*/
inline Iterator End(void)
Iterator End(void)
{
ASSERT(OwnsLock());
@ -98,7 +98,7 @@ public:
*
* @param it The iterator.
*/
inline void Remove(Iterator it)
void Remove(Iterator it)
{
ASSERT(OwnsLock());

View File

@ -51,12 +51,12 @@ public:
Value Invoke(const std::vector<Value>& arguments = std::vector<Value>());
Value InvokeThis(const Value& otherThis, const std::vector<Value>& arguments = std::vector<Value>());
inline bool IsSideEffectFree(void) const
bool IsSideEffectFree(void) const
{
return GetSideEffectFree();
}
inline bool IsDeprecated(void) const
bool IsDeprecated(void) const
{
return GetDeprecated();
}

View File

@ -35,12 +35,12 @@ public:
: m_Callback(callback), m_Priority(priority)
{ }
inline bool operator<(const DeferredInitializer& other) const
bool operator<(const DeferredInitializer& other) const
{
return m_Priority < other.m_Priority;
}
inline void operator()(void)
void operator()(void)
{
m_Callback();
}

View File

@ -109,17 +109,17 @@ I2_BASE_API void IcingaLog(LogSeverity severity, const String& facility, const S
class Log
{
public:
inline Log(LogSeverity severity, const String& facility, const String& message)
Log(LogSeverity severity, const String& facility, const String& message)
: m_Severity(severity), m_Facility(facility)
{
m_Buffer << message;
}
inline Log(LogSeverity severity, const String& facility)
Log(LogSeverity severity, const String& facility)
: m_Severity(severity), m_Facility(facility)
{ }
inline ~Log(void)
~Log(void)
{
IcingaLog(m_Severity, m_Facility, m_Buffer.str());
}

View File

@ -34,30 +34,30 @@ namespace icinga
struct I2_BASE_API ObjectLock
{
public:
inline ObjectLock(void)
ObjectLock(void)
: m_Object(nullptr), m_Locked(false)
{ }
inline ~ObjectLock(void)
~ObjectLock(void)
{
Unlock();
}
inline ObjectLock(const Object::Ptr& object)
ObjectLock(const Object::Ptr& object)
: m_Object(object.get()), m_Locked(false)
{
if (m_Object)
Lock();
}
inline ObjectLock(const Object *object)
ObjectLock(const Object *object)
: m_Object(object), m_Locked(false)
{
if (m_Object)
Lock();
}
inline static void LockMutex(const Object *object)
static void LockMutex(const Object *object)
{
unsigned int it = 0;
@ -94,7 +94,7 @@ public:
#endif /* _WIN32 */
}
inline void Lock(void)
void Lock(void)
{
ASSERT(!m_Locked && m_Object);
@ -111,7 +111,7 @@ public:
#endif /* I2_DEBUG */
}
inline static void Spin(unsigned int it)
static void Spin(unsigned int it)
{
if (it < 8) {
/* Do nothing. */
@ -130,7 +130,7 @@ public:
}
}
inline void Unlock(void)
void Unlock(void)
{
#ifdef I2_DEBUG
if (m_Locked) {

View File

@ -52,8 +52,8 @@ private:
static boost::thread_specific_ptr<std::stack<ScriptFrame *> > m_ScriptFrames;
static Array::Ptr m_Imports;
inline static void PushFrame(ScriptFrame *frame);
inline static ScriptFrame *PopFrame(void);
static void PushFrame(ScriptFrame *frame);
static ScriptFrame *PopFrame(void);
void InitializeFrame(void);
};

View File

@ -58,23 +58,23 @@ public:
typedef std::string::size_type SizeType;
inline String(void)
String(void)
: m_Data()
{ }
inline String(const char *data)
String(const char *data)
: m_Data(data)
{ }
inline String(const std::string& data)
String(const std::string& data)
: m_Data(data)
{ }
inline String(std::string&& data)
String(std::string&& data)
: m_Data(data)
{ }
inline String(String::SizeType n, char c)
String(String::SizeType n, char c)
: m_Data(n, c)
{ }
@ -90,7 +90,7 @@ public:
String(Value&& other);
#endif /* _MSC_VER */
inline ~String(void)
~String(void)
{ }
template<typename InputIterator>
@ -112,35 +112,35 @@ public:
String& operator=(Value&& rhs);
inline String& operator=(const std::string& rhs)
String& operator=(const std::string& rhs)
{
m_Data = rhs;
return *this;
}
inline String& operator=(const char *rhs)
String& operator=(const char *rhs)
{
m_Data = rhs;
return *this;
}
inline const char& operator[](SizeType pos) const
const char& operator[](SizeType pos) const
{
return m_Data[pos];
}
inline char& operator[](SizeType pos)
char& operator[](SizeType pos)
{
return m_Data[pos];
}
inline String& operator+=(const String& rhs)
String& operator+=(const String& rhs)
{
m_Data += rhs.m_Data;
return *this;
}
inline String& operator+=(const char *rhs)
String& operator+=(const char *rhs)
{
m_Data += rhs;
return *this;
@ -148,153 +148,153 @@ public:
String& operator+=(const Value& rhs);
inline String& operator+=(char rhs)
String& operator+=(char rhs)
{
m_Data += rhs;
return *this;
}
inline bool IsEmpty(void) const
bool IsEmpty(void) const
{
return m_Data.empty();
}
inline bool operator<(const String& rhs) const
bool operator<(const String& rhs) const
{
return m_Data < rhs.m_Data;
}
inline operator const std::string&(void) const
operator const std::string&(void) const
{
return m_Data;
}
inline const char *CStr(void) const
const char *CStr(void) const
{
return m_Data.c_str();
}
inline void Clear(void)
void Clear(void)
{
m_Data.clear();
}
inline SizeType GetLength(void) const
SizeType GetLength(void) const
{
return m_Data.size();
}
inline std::string& GetData(void)
std::string& GetData(void)
{
return m_Data;
}
inline const std::string& GetData(void) const
const std::string& GetData(void) const
{
return m_Data;
}
inline SizeType Find(const String& str, SizeType pos = 0) const
SizeType Find(const String& str, SizeType pos = 0) const
{
return m_Data.find(str, pos);
}
inline SizeType RFind(const String& str, SizeType pos = NPos) const
SizeType RFind(const String& str, SizeType pos = NPos) const
{
return m_Data.rfind(str, pos);
}
inline SizeType FindFirstOf(const char *s, SizeType pos = 0) const
SizeType FindFirstOf(const char *s, SizeType pos = 0) const
{
return m_Data.find_first_of(s, pos);
}
inline SizeType FindFirstOf(char ch, SizeType pos = 0) const
SizeType FindFirstOf(char ch, SizeType pos = 0) const
{
return m_Data.find_first_of(ch, pos);
}
inline SizeType FindFirstNotOf(const char *s, SizeType pos = 0) const
SizeType FindFirstNotOf(const char *s, SizeType pos = 0) const
{
return m_Data.find_first_not_of(s, pos);
}
inline SizeType FindFirstNotOf(char ch, SizeType pos = 0) const
SizeType FindFirstNotOf(char ch, SizeType pos = 0) const
{
return m_Data.find_first_not_of(ch, pos);
}
inline SizeType FindLastOf(const char *s, SizeType pos = NPos) const
SizeType FindLastOf(const char *s, SizeType pos = NPos) const
{
return m_Data.find_last_of(s, pos);
}
inline SizeType FindLastOf(char ch, SizeType pos = NPos) const
SizeType FindLastOf(char ch, SizeType pos = NPos) const
{
return m_Data.find_last_of(ch, pos);
}
inline String SubStr(SizeType first, SizeType len = NPos) const
String SubStr(SizeType first, SizeType len = NPos) const
{
return m_Data.substr(first, len);
}
inline std::vector<String> Split(const char *separators) const
std::vector<String> Split(const char *separators) const
{
std::vector<String> result;
boost::algorithm::split(result, m_Data, boost::is_any_of(separators));
return result;
}
inline void Replace(SizeType first, SizeType second, const String& str)
void Replace(SizeType first, SizeType second, const String& str)
{
m_Data.replace(first, second, str);
}
inline String Trim(void) const
String Trim(void) const
{
String t = m_Data;
boost::algorithm::trim(t);
return t;
}
inline String ToLower(void) const
String ToLower(void) const
{
String t = m_Data;
boost::algorithm::to_lower(t);
return t;
}
inline String ToUpper(void) const
String ToUpper(void) const
{
String t = m_Data;
boost::algorithm::to_upper(t);
return t;
}
inline String Reverse(void) const
String Reverse(void) const
{
String t = m_Data;
std::reverse(t.m_Data.begin(), t.m_Data.end());
return t;
}
inline void Append(int count, char ch)
void Append(int count, char ch)
{
m_Data.append(count, ch);
}
inline bool Contains(const String& str) const
bool Contains(const String& str) const
{
return (m_Data.find(str) != std::string::npos);
}
inline void swap(String& str)
void swap(String& str)
{
m_Data.swap(str.m_Data);
}
inline Iterator erase(Iterator first, Iterator last)
Iterator erase(Iterator first, Iterator last)
{
return m_Data.erase(first, last);
}
@ -305,42 +305,42 @@ public:
m_Data.insert(p, first, last);
}
inline Iterator Begin(void)
Iterator Begin(void)
{
return m_Data.begin();
}
inline ConstIterator Begin(void) const
ConstIterator Begin(void) const
{
return m_Data.begin();
}
inline Iterator End(void)
Iterator End(void)
{
return m_Data.end();
}
inline ConstIterator End(void) const
ConstIterator End(void) const
{
return m_Data.end();
}
inline ReverseIterator RBegin(void)
ReverseIterator RBegin(void)
{
return m_Data.rbegin();
}
inline ConstReverseIterator RBegin(void) const
ConstReverseIterator RBegin(void) const
{
return m_Data.rbegin();
}
inline ReverseIterator REnd(void)
ReverseIterator REnd(void)
{
return m_Data.rend();
}
inline ConstReverseIterator REnd(void) const
ConstReverseIterator REnd(void) const
{
return m_Data.rend();
}

View File

@ -52,53 +52,53 @@ enum ValueType
class I2_BASE_API Value
{
public:
inline Value(void)
Value(void)
{ }
inline Value(std::nullptr_t)
Value(std::nullptr_t)
{ }
inline Value(int value)
Value(int value)
: m_Value(double(value))
{ }
inline Value(unsigned int value)
Value(unsigned int value)
: m_Value(double(value))
{ }
inline Value(long value)
Value(long value)
: m_Value(double(value))
{ }
inline Value(unsigned long value)
Value(unsigned long value)
: m_Value(double(value))
{ }
inline Value(long long value)
Value(long long value)
: m_Value(double(value))
{ }
inline Value(unsigned long long value)
Value(unsigned long long value)
: m_Value(double(value))
{ }
inline Value(double value)
Value(double value)
: m_Value(value)
{ }
inline Value(bool value)
Value(bool value)
: m_Value(value)
{ }
inline Value(const String& value)
Value(const String& value)
: m_Value(value)
{ }
inline Value(String&& value)
Value(String&& value)
: m_Value(value)
{ }
inline Value(const char *value)
Value(const char *value)
: m_Value(String(value))
{ }
@ -115,7 +115,7 @@ public:
#endif /* BOOST_VERSION */
}
inline Value(Object *value)
Value(Object *value)
{
if (!value)
return;
@ -124,7 +124,7 @@ public:
}
template<typename T>
inline Value(const intrusive_ptr<T>& value)
Value(const intrusive_ptr<T>& value)
{
if (!value)
return;
@ -198,7 +198,7 @@ public:
*
* @returns true if the variant is empty, false otherwise.
*/
inline bool IsEmpty(void) const
bool IsEmpty(void) const
{
return (GetType() == ValueEmpty || (IsString() && boost::get<String>(m_Value).IsEmpty()));
}
@ -208,7 +208,7 @@ public:
*
* @returns true if the variant is scalar, false otherwise.
*/
inline bool IsScalar(void) const
bool IsScalar(void) const
{
return !IsEmpty() && !IsObject();
}
@ -218,7 +218,7 @@ public:
*
* @returns true if the variant is a number.
*/
inline bool IsNumber(void) const
bool IsNumber(void) const
{
return (GetType() == ValueNumber);
}
@ -228,7 +228,7 @@ public:
*
* @returns true if the variant is a boolean.
*/
inline bool IsBoolean(void) const
bool IsBoolean(void) const
{
return (GetType() == ValueBoolean);
}
@ -238,7 +238,7 @@ public:
*
* @returns true if the variant is a string.
*/
inline bool IsString(void) const
bool IsString(void) const
{
return (GetType() == ValueString);
}
@ -248,7 +248,7 @@ public:
*
* @returns true if the variant is a non-null object, false otherwise.
*/
inline bool IsObject(void) const
bool IsObject(void) const
{
return (GetType() == ValueObject);
}
@ -267,12 +267,12 @@ public:
*
* @returns The type.
*/
inline ValueType GetType(void) const
ValueType GetType(void) const
{
return static_cast<ValueType>(m_Value.which());
}
inline void Swap(Value& other)
void Swap(Value& other)
{
m_Value.swap(other.m_Value);
}

View File

@ -44,12 +44,12 @@ public:
: m_Hints(std::move(hints))
{ }
inline void AddMessage(const String& message, const DebugInfo& di)
void AddMessage(const String& message, const DebugInfo& di)
{
GetMessages()->Add(new Array({ message, di.Path, di.FirstLine, di.FirstColumn, di.LastLine, di.LastColumn }));
}
inline DebugHint GetChild(const String& name)
DebugHint GetChild(const String& name)
{
const Dictionary::Ptr& children = GetChildren();