started with object proxy
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
#ifndef COLLECTION_HPP
|
||||
#define COLLECTION_HPP
|
||||
|
||||
#include <vector>
|
||||
|
||||
namespace matador::object {
|
||||
|
||||
template < class Type >
|
||||
class collection {
|
||||
public:
|
||||
|
||||
private:
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
#endif //COLLECTION_HPP
|
||||
@@ -0,0 +1,14 @@
|
||||
#ifndef DICTIONARY_HPP
|
||||
#define DICTIONARY_HPP
|
||||
|
||||
namespace matador::object {
|
||||
|
||||
template < class Key, class Value >
|
||||
class dictionary {
|
||||
public:
|
||||
|
||||
private:
|
||||
};
|
||||
|
||||
}
|
||||
#endif //DICTIONARY_HPP
|
||||
@@ -0,0 +1,26 @@
|
||||
#ifndef OBJECT_PROXY_HPP
|
||||
#define OBJECT_PROXY_HPP
|
||||
|
||||
#include <memory>
|
||||
|
||||
namespace matador::object {
|
||||
|
||||
class basic_object_proxy {
|
||||
public:
|
||||
virtual ~basic_object_proxy() = default;
|
||||
|
||||
virtual void *get() const = 0;
|
||||
};
|
||||
|
||||
template<class Type>
|
||||
class object_proxy : public basic_object_proxy {
|
||||
public:
|
||||
void *get() const override { return static_cast<Type *>(this)->get(); }
|
||||
|
||||
Type* operator->() const { return obj_.get(); }
|
||||
private:
|
||||
std::shared_ptr<Type> obj_{};
|
||||
};
|
||||
|
||||
}
|
||||
#endif //OBJECT_PROXY_HPP
|
||||
Reference in New Issue
Block a user