rjp/rjp++/include/array.hpp
2020-03-23 10:38:39 -07:00

62 lines
1.3 KiB
C++

#ifndef RJP_ARRAY_HPP
#define RJP_ARRAY_HPP
#include <rjp.h>
#include "iterator.hpp"
#include "value.hpp"
namespace rjp{
class array_iterator : protected detail::iterator_base
{
protected:
RJP_array_iterator m_it;
public:
array_iterator(void) = default;
array_iterator(RJP_value* v);
array_iterator(const array_iterator&) = delete;
array_iterator(array_iterator&& a);
~array_iterator(void);
array_iterator& operator=(const array_iterator&) = delete;
array_iterator& operator=(array_iterator&& o);
bool operator==(const array_iterator& o)const;
bool operator!=(const array_iterator& o)const;
value operator*(void)const;
value_wrapper operator->(void)const;
array_iterator& operator++(void);
};
class array : public value
{
public:
using iterator = array_iterator;
using const_iterator = const iterator;
public:
using value::value;
array(void);
array(const value& val);
array(value&& val);
array(const array&) = default;
array(array&&) = default;
~array(void) = default;
array& operator=(const array&) = default;
array& operator=(array&&) = default;
value add(void);
value& remove(value& val);
void destroy(value&& val);
iterator begin(void);
iterator end(void);
const_iterator begin(void)const;
const_iterator end(void)const;
};
}
#endif