diff options
| author | randomdan <randomdan@localhost> | 2012-12-09 15:53:58 +0000 | 
|---|---|---|
| committer | randomdan <randomdan@localhost> | 2012-12-09 15:53:58 +0000 | 
| commit | 3b41dcbf2ea8189eb001318f502845fca3d73bb2 (patch) | |
| tree | 757090b021751abd782ea864a018c4cfc07670d2 | |
| parent | Support default values of different type to target values in options (diff) | |
| download | project2-3b41dcbf2ea8189eb001318f502845fca3d73bb2.tar.bz2 project2-3b41dcbf2ea8189eb001318f502845fca3d73bb2.tar.xz project2-3b41dcbf2ea8189eb001318f502845fca3d73bb2.zip  | |
Add TypePointer, which creates a new instance of its value pointer on assignment from a registered type name string
| -rw-r--r-- | project2/common/typePointer.h | 17 | 
1 files changed, 17 insertions, 0 deletions
diff --git a/project2/common/typePointer.h b/project2/common/typePointer.h new file mode 100644 index 0000000..95bf28a --- /dev/null +++ b/project2/common/typePointer.h @@ -0,0 +1,17 @@ +#ifndef TYPEPOINTER_H +#define TYPEPOINTER_H + +template <typename T, typename P = typename boost::intrusive_ptr<T>> +class TypePointer : public P { +	public: +		TypePointer() { } +		TypePointer(const std::string &) { } + +		TypePointer & operator=(const std::string & value) { +			P::operator=(GenLoader<T>::createNew(value)); +			return *this; +		} +}; + +#endif +  | 
