Click here to Skip to main content
Click here to Skip to main content
Add your own
alternative version

RMI for C++

, 6 Aug 2009
User-friendly remote method invocation in C++.
rcf.zip
RCF
demo
vs2003
RCF
Client
Server
doc
include
RCF
Connection.inl
Marshal.inl
Multiplexer.inl
RCF.inl
RcfServer.inl
ServerStub.inl
Protocol
util
Platform
Compiler
bcc55
cw80
gcc32
icl70
msvc71
Library
bcc55
cw80
gcc32
msvc60
msvc71
Machine
SPARC
x86
OS
Cygwin
Unix
Windows
System
NonWindows
Windows
Threads
SF
src
RCF
Protocol
util
SF
test
Jamfile
Jamrules
borland
Jamfile
Jamrules
vs2003
RCF
RCF
RCFTest
#ifndef _SF_PLATFORM_THREADS_THREADSPROXY_HPP_
#define _SF_PLATFORM_THREADS_THREADSPROXY_HPP_

// Single-threaded proxy for boost threads

#include <memory>

namespace Platform {

    namespace Threads {

        class thread {
        public:
            template<typename T> thread(      T &t) { t(); }
            template<typename T> thread(const T &t) { const_cast<T &>(t)(); }
            void join() {}
        };

        class thread_group {
        public:
            template<typename T> thread *create_thread(const T &t) { const_cast<T &>(t)(); return NULL; }
            void add_thread(thread *) {}
            void remove_thread(thread *) {}
            void join_all() {}
        };

        template<typename T>
        struct thread_specific_ptr {
            typedef std::auto_ptr<T> Val;
        };

        struct lock_t {
            template<typename T1> lock_t(const T1 &) {}
            template<typename T1, typename T2> lock_t(const T1 &, const T2 &t2) {}
            bool locked() { return true; }
            void lock() {}
            void unlock() {}
        };

        struct mutex                    { typedef lock_t scoped_lock; };
        struct recursive_mutex          { typedef lock_t scoped_lock; };
        struct recursive_try_mutex      { typedef lock_t scoped_lock; typedef lock_t scoped_try_lock; };
        struct try_mutex                { typedef lock_t scoped_lock; typedef lock_t scoped_try_lock; };

        enum read_write_scheduling_policy { 
            writer_priority, 
            reader_priority, 
            alternating_many_reads, 
            alternating_single_read 
        };
        
        struct read_write_mutex { 
            read_write_mutex(read_write_scheduling_policy policy) {}
            typedef lock_t scoped_read_lock; 
            typedef lock_t scoped_write_lock; 
            typedef lock_t scoped_read_write_lock; 
        };

        struct condition {
            condition() {}
            template<typename T> void  wait(const T &) {}
            void notify_one() {}
            void notify_all() {}
        };

    } // namespace Threads

} // namespace Platform

#endif // ! _UTIL_PLATFORM_BOOST_THREADSPROXY_HPP_

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

Jarl Lindrud

Australia Australia
Software developer, ex-resident of Sweden and now living in Canberra, Australia, working on distributed C++ applications. Jarl enjoys programming, but prefers skiing and playing table tennis. He derives immense satisfaction from referring to himself in third person.

| Advertise | Privacy | Mobile
Web02 | 2.8.140827.1 | Last Updated 6 Aug 2009
Article Copyright 2005 by Jarl Lindrud
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid