various bug fixes

This commit is contained in:
Daniel Larimer 2013-02-03 21:11:08 -05:00
parent 178dcea0c2
commit dff6b72ace
4 changed files with 39 additions and 4 deletions

View file

@ -65,7 +65,7 @@ namespace fc { namespace json {
this->_vtable.reset(new fc::detail::vtable<InterfaceType,fc::detail::actor_member>() ); this->_vtable.reset(new fc::detail::vtable<InterfaceType,fc::detail::actor_member>() );
this->_vtable->template visit_other<InterfaceType>( fc::json::detail::vtable_visitor(_con) ); this->_vtable->template visit_other<InterfaceType>( fc::json::detail::vtable_visitor(_con) );
} }
const rpc_connection& connection()const { return _con; } const rpc_connection::ptr& connection()const { return _con; }
private: private:
rpc_connection::ptr _con; rpc_connection::ptr _con;

View file

@ -16,19 +16,45 @@ namespace fc {
_handlers.push_back( c ); _handlers.push_back( c );
return reinterpret_cast<connection_id_type>(c); return reinterpret_cast<connection_id_type>(c);
} }
#ifdef WIN32
template<typename Arg>
void emit( Arg&& arg ) {
for( size_t i = 0; i < _handlers.size(); ++i ) {
(*_handlers[i])( fc::forward<Arg>(arg) );
}
}
template<typename Arg>
void operator()( Arg&& arg ) {
for( size_t i = 0; i < _handlers.size(); ++i ) {
(*_handlers[i])( fc::forward<Arg>(arg) );
}
}
template<typename Arg,typename Arg2>
void emit( Arg&& arg, Arg2&& arg2 ) {
for( size_t i = 0; i < _handlers.size(); ++i ) {
(*_handlers[i])( fc::forward<Arg>(arg), fc::forward<Arg2>(arg2) );
}
}
template<typename Arg, typename Arg2>
void operator()( Arg&& arg, Arg2&& arg2 ) {
for( size_t i = 0; i < _handlers.size(); ++i ) {
(*_handlers[i])( fc::forward<Arg>(arg), fc::forward<Arg2>(arg2) );
}
}
#else
template<typename... Args> template<typename... Args>
void emit( Args&&... args ) { void emit( Args&&... args ) {
for( size_t i = 0; i < _handlers.size(); ++i ) { for( size_t i = 0; i < _handlers.size(); ++i ) {
(*_handlers[i])( args... ); (*_handlers[i])( fc::forward<Args>(args)... );
} }
} }
template<typename... Args> template<typename... Args>
void operator()( Args&&... args ) { void operator()( Args&&... args ) {
for( size_t i = 0; i < _handlers.size(); ++i ) { for( size_t i = 0; i < _handlers.size(); ++i ) {
(*_handlers[i])( args... ); (*_handlers[i])( fc::forward<Args>(args)... );
} }
} }
#endif
void disconnect( connection_id_type cid ) { void disconnect( connection_id_type cid ) {
auto itr = _handlers.begin(); auto itr = _handlers.begin();

View file

@ -103,6 +103,13 @@ namespace fc {
*/ */
void mkdir( const fc::path& remote_dir, int mode = owner_read|owner_write|owner_exec ); void mkdir( const fc::path& remote_dir, int mode = owner_read|owner_write|owner_exec );
/**
* Create all parent directories for remote_dir if they do not exist.
*
* @post remote_dir exists.
*/
void create_directories( const fc::path& remote_dir, int mode = owner_read|owner_write|owner_exec );
void close(); void close();
client(); client();

View file

@ -48,6 +48,8 @@ namespace fc {
* @brief returns a stream that reads from the process' stderr * @brief returns a stream that reads from the process' stderr
*/ */
fc::istream& err_stream()const; fc::istream& err_stream()const;
process& operator=( const process& p );
private: private:
friend class client; friend class client;
process( client& c, const fc::string& cmd, const fc::string& pty_type = fc::string() ); process( client& c, const fc::string& cmd, const fc::string& pty_type = fc::string() );