mirror of https://github.com/Icinga/icinga2.git
parent
59b81168ff
commit
a786dfa2ca
|
@ -21,6 +21,7 @@
|
||||||
#define ARRAY_H
|
#define ARRAY_H
|
||||||
|
|
||||||
#include "base/i2-base.hpp"
|
#include "base/i2-base.hpp"
|
||||||
|
#include "base/objectlock.hpp"
|
||||||
#include "base/value.hpp"
|
#include "base/value.hpp"
|
||||||
#include <boost/range/iterator.hpp>
|
#include <boost/range/iterator.hpp>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
@ -100,6 +101,15 @@ public:
|
||||||
|
|
||||||
static Object::Ptr GetPrototype(void);
|
static Object::Ptr GetPrototype(void);
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
static Array::Ptr FromVector(const std::vector<T>& v)
|
||||||
|
{
|
||||||
|
Array::Ptr result = new Array();
|
||||||
|
ObjectLock olock(result);
|
||||||
|
std::copy(v.begin(), v.end(), std::back_inserter(result->m_Data));
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::vector<Value> m_Data; /**< The data for the array. */
|
std::vector<Value> m_Data; /**< The data for the array. */
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue