adding dynmaic_poitner_cast + fixed includes
This commit is contained in:
parent
dc91979409
commit
4e42769366
4 changed files with 17 additions and 1 deletions
|
|
@ -2,6 +2,7 @@
|
||||||
#define _FC_DATASTREAM_HPP_
|
#define _FC_DATASTREAM_HPP_
|
||||||
#include <fc/utility.hpp>
|
#include <fc/utility.hpp>
|
||||||
#include <fc/exception.hpp>
|
#include <fc/exception.hpp>
|
||||||
|
#include <string.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
namespace fc {
|
namespace fc {
|
||||||
|
|
|
||||||
|
|
@ -4,9 +4,12 @@
|
||||||
#include <fc/datastream.hpp>
|
#include <fc/datastream.hpp>
|
||||||
#include <fc/varint.hpp>
|
#include <fc/varint.hpp>
|
||||||
#include <fc/optional.hpp>
|
#include <fc/optional.hpp>
|
||||||
|
#include <fc/vector.hpp>
|
||||||
//#include <fc/value.hpp>
|
//#include <fc/value.hpp>
|
||||||
|
|
||||||
namespace fc { namespace raw {
|
namespace fc {
|
||||||
|
class value;
|
||||||
|
namespace raw {
|
||||||
|
|
||||||
template<typename Stream, typename T>
|
template<typename Stream, typename T>
|
||||||
void unpack( Stream& s, fc::optional<T>& v );
|
void unpack( Stream& s, fc::optional<T>& v );
|
||||||
|
|
|
||||||
|
|
@ -26,6 +26,12 @@ namespace fc {
|
||||||
template<typename T>
|
template<typename T>
|
||||||
class shared_ptr {
|
class shared_ptr {
|
||||||
public:
|
public:
|
||||||
|
template<typename Other>
|
||||||
|
shared_ptr( const shared_ptr<Other>& o )
|
||||||
|
:_ptr(o.get()) {
|
||||||
|
if(_ptr) _ptr->retain();
|
||||||
|
}
|
||||||
|
|
||||||
shared_ptr( T* t, bool inc = false )
|
shared_ptr( T* t, bool inc = false )
|
||||||
:_ptr(t) { if( inc ) t->retain(); }
|
:_ptr(t) { if( inc ) t->retain(); }
|
||||||
|
|
||||||
|
|
@ -70,6 +76,11 @@ namespace fc {
|
||||||
private:
|
private:
|
||||||
T* _ptr;
|
T* _ptr;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
template<typename T, typename O>
|
||||||
|
fc::shared_ptr<T> dynamic_pointer_cast( const fc::shared_ptr<O>& t ) {
|
||||||
|
return fc::shared_ptr<T>( dynamic_cast<T*>(t.get()), true );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,7 @@
|
||||||
#ifndef _FC_STATIC_REFLECT_HPP_
|
#ifndef _FC_STATIC_REFLECT_HPP_
|
||||||
#define _FC_STATIC_REFLECT_HPP_
|
#define _FC_STATIC_REFLECT_HPP_
|
||||||
|
|
||||||
|
#include <fc/utility.hpp>
|
||||||
#include <boost/static_assert.hpp>
|
#include <boost/static_assert.hpp>
|
||||||
#include <boost/preprocessor/seq/for_each_i.hpp>
|
#include <boost/preprocessor/seq/for_each_i.hpp>
|
||||||
#include <boost/preprocessor/seq/for_each.hpp>
|
#include <boost/preprocessor/seq/for_each.hpp>
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue