/**
 * @file
 * $Id$
 * $Revision$
 * $Author$
 * $Date$
 *
 * This file is part of The iWear Framework.
 *
 * The iWear Framework is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by the
 * Free Software Foundation as in version 2 of the License.

 * 
 * The iWear Framework is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
 * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
 * more details.
 * 
 * You should have received a copy of the GNU General Public License along with
 * The iWear Framework; if not, write to the Free Software Foundation, Inc., 59
 * Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

#ifndef __IWREMOTE_REMOTE_ENUMS_H
#define __IWREMOTE_REMOTE_ENUMS_H

namespace iwear
{
    namespace net
    {
enum resolve_behaviour
{
    direct_associate,   ///< Directly associate the returned object
    deferred_associate, ///< Dont associate the returned object, do it on first
    ///< call (but setup internal structures so that we
    ///< dont need to search for it)
    oneshot_deferred,   ///< @exp like deferr, but configure for only one call then deassociate
    unassociated,	///< Dont associate to the object in question, setup
			///< all thats needed to just give away the call.
    num_resolve_behaviour
};

inline const char* to_string( resolve_behaviour rb )
{
    switch(rb)
    {
	case direct_associate:
	    return "resolve_behaviour::direct_associate";
	case deferred_associate:
	    return "resolve_behaviour::deferred_associate";
	case oneshot_deferred:
	    return "resolve_behaviour::oneshot_deferred";
	case unassociated:
	    return "resolve_behaviour::unassociated";
	default:
	    return "resolve_behaviour::<invalid_value>";
    }
}

inline std::ostream& operator<<(std::ostream& o, resolve_behaviour st)
{
    o << to_string(st);
    o << "(";
    o << static_cast<uint32_t>(st) << ")";
    return o;
}

/**
 * The higher behaviour also does a search in what the lower behaviours search.
 * The stop behaviour may differ, so that some functions might stop if they
 * have found something in the cache, and others only stop when everything is
 * done.
 */
enum search_behaviour
{
    search_cache,       ///< Search in local cache only
    search_known,       ///< Ask known hosts (those connected and in cache)
    search_broadcast,   ///< Do a (W)LAN wide broadcast to search
    search_p2p,         ///< Recursively search known hosts (Level is configured)
    num_search_behaviour
};

enum rpc_type
{
    rpc_remote, ///< This means this connection is to some remote system e.g. via IPv4/v6, Bluetooth IrDA etc.    rpc_ipc,    ///< This type is for communication between process on localhost
    rpc_local,  ///< This is for objects within the current process
    rpc_external, ///< This is for plugin types...
    num_rpc_type,
};

}
}
#endif
