Click here to Skip to main content
15,881,588 members
Articles / Programming Languages / C++

RMI for C++

Rate me:
Please Sign up or sign in to vote.
4.87/5 (113 votes)
6 Aug 2009CPOL8 min read 812.4K   4.6K   153  
User-friendly remote method invocation in C++.
#ifndef _UTIL_PLATFORM_LIBRARY_MSVC71_LIBRARY_HPP_
#define _UTIL_PLATFORM_LIBRARY_MSVC71_LIBRARY_HPP_

// Library specific stuff for msvc 7.1

#include <hash_map>

namespace Platform {

    namespace Library {

        template<typename K, typename HashFunction>
        class hash_compare : public stdext::hash_compare<K> {
        public:
            size_t operator()(const K &a) const { return hash(a); }
            bool operator()(const K &lhs, const K &rhs) const { return lhs < rhs; }
        private:
            HashFunction hash;
        };

        template<typename Key, typename Type, typename HashFunction>
        struct hash_map_t {
            typedef stdext::hash_map<Key, Type, hash_compare<Key, HashFunction> > Val;
        };

    } // namespace Library

} // namespace Platform


#endif _UTIL_PLATFORM_LIBRARY_MSVC71_LIBRARY_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)


Written By
Australia Australia
Software developer, from Sweden and now living in Canberra, Australia, working on distributed C++ applications. When he is not programming, Jarl enjoys skiing and playing table tennis. He derives immense satisfaction from referring to himself in third person.

Comments and Discussions