ret = m_Data.insert(make_pair(key, value));
if (!ret.second)
ret.first->second = value;
-
- OnItemModified(key, value);
}
/**
return;
m_Data.erase(it);
-
- OnItemModified(key, Empty);
}
/**
{
String key = it->first;
m_Data.erase(it);
-
- OnItemModified(key, Empty);
}
/**
return json;
}
-void Dictionary::OnItemModified(const String& key, const Value& value)
-{ }
static Dictionary::Ptr FromJson(cJSON *json);
cJSON *ToJson(void) const;
- virtual void OnItemModified(const String& key, const Value& value);
-
private:
map<String, Value> m_Data;
};
m_CurrentTx = 0;
}
-void DynamicObject::OnAttributeChanged(const String& name, const Value& oldValue)
+void DynamicObject::OnAttributeChanged(const String&, const Value&)
{ }
+
}
-#endif /* IOQUEUE_H */
\ No newline at end of file
+#endif /* IOQUEUE_H */
private:
Object(const Object& other);
- Object operator=(const Object& rhs);
+ Object& operator=(const Object& rhs);
static mutex m_Mutex;
static vector<Object::Ptr> m_HeldObjects;
typedef shared_ptr<Process> Ptr;
typedef weak_ptr<Process> WeakPtr;
- static const int MaxTasksPerThread = 128;
+ static const deque<Process::Ptr>::size_type MaxTasksPerThread = 128;
Process(const String& command);
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
- * along with this program; if not, write to the Free Software Foundation *
+ * aRingBuffer::SizeType with this program; if not, write to the Free Software Foundation *
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. *
******************************************************************************/
using namespace icinga;
-RingBuffer::RingBuffer(long slots)
+RingBuffer::RingBuffer(RingBuffer::SizeType slots)
: m_Slots(slots, 0), m_Offset(0)
{ }
-long RingBuffer::GetLength(void) const
+RingBuffer::SizeType RingBuffer::GetLength(void) const
{
return m_Slots.size();
}
-void RingBuffer::InsertValue(long tv, int num)
+void RingBuffer::InsertValue(RingBuffer::SizeType tv, int num)
{
vector<int>::size_type offsetTarget = tv % m_Slots.size();
m_Slots[m_Offset] += num;
}
-int RingBuffer::GetValues(long span) const
+int RingBuffer::GetValues(RingBuffer::SizeType span) const
{
if (span > m_Slots.size())
span = m_Slots.size();
class I2_BASE_API RingBuffer
{
public:
- RingBuffer(long slots);
+ typedef vector<int>::size_type SizeType;
- long GetLength(void) const;
- void InsertValue(long tv, int num);
- int GetValues(long span) const;
+ RingBuffer(SizeType slots);
+
+ SizeType GetLength(void) const;
+ void InsertValue(SizeType tv, int num);
+ int GetValues(SizeType span) const;
private:
vector<int> m_Slots;
- vector<int>::size_type m_Offset;
+ SizeType m_Offset;
};
}
* @param role The role of the TCP client socket.
*/
TcpClient::TcpClient(TcpClientRole role)
- : m_Role(role), m_SendQueue(boost::make_shared<FIFO>()),
- m_RecvQueue(boost::make_shared<FIFO>())
+ : m_SendQueue(boost::make_shared<FIFO>()),
+ m_RecvQueue(boost::make_shared<FIFO>()),
+ m_Role(role)
{ }
/**
Socket::Start();
}
-/**
- * Takes a certificate as an argument. Does nothing.
- *
- * @param certificate An X509 certificate.
- */
-void TlsClient::NullCertificateDeleter(X509 *certificate)
-{
- /* Nothing to do here. */
-}
-
/**
* Retrieves the X509 certficate for this client.
*
{
mutex::scoped_lock lock(m_SocketMutex);
- return shared_ptr<X509>(SSL_get_certificate(m_SSL.get()), &TlsClient::NullCertificateDeleter);
+ return shared_ptr<X509>(SSL_get_certificate(m_SSL.get()), &Utility::NullDeleter);
}
/**
/**
* Null deleter. Used as a parameter for the shared_ptr constructor.
*
- * @param obj The object that should be deleted.
+ * @param -- The object that should be deleted.
*/
-void Utility::NullDeleter(void *obj)
+void Utility::NullDeleter(void *)
{
/* Nothing to do here. */
}
int yylex(YYSTYPE *lvalp, YYLTYPE *llocp, void *scanner);
-void yyerror(YYLTYPE *locp, ConfigCompiler *context, const char *err)
+void yyerror(YYLTYPE *locp, ConfigCompiler *, const char *err)
{
stringstream message;
message << *locp << ": " << err;
int yylex(YYSTYPE *lvalp, YYLTYPE *llocp, void *scanner);
-void yyerror(YYLTYPE *locp, ConfigCompiler *context, const char *err)
+void yyerror(YYLTYPE *locp, ConfigCompiler *, const char *err)
{
stringstream message;
message << *locp << ": " << err;