// ********************************************************************** // // Copyright (c) 2002 // MutableRealms, Inc. // Huntsville, AL, USA // // All Rights Reserved // // ********************************************************************** #ifndef ICE_REFERENCE_H #define ICE_REFERENCE_H #include #include #include #include namespace IceInternal { class IntStream; class Reference : public ::IceUtil::Shared { public: enum Mode { ModeTwoway, ModeOneway, ModeBatchOneway, ModeDatagram, ModeBatchDatagram }; Reference(const InstancePtr&, const std::string&, Mode, bool, const std::vector&, const std::vector&); Reference(const InstancePtr&, const std::string&); Reference(const std::string&, IntStream*); // // Marshal the reference // void streamWrite(IntStream*) const; // // Convert the reference to its string form // std::string toString() const; // // All members are const, because References are immutable. // const InstancePtr instance; const std::string identity; const Mode mode; const bool secure; const std::vector origEndpoints; // Original endpoints const std::vector endpoints; // Actual endpoints (set by a location forward) // // Get a new reference, based on the existing one, overwriting // certain values. // ReferencePtr changeIdentity(const std::string&) const; ReferencePtr changeTimeout(int) const; ReferencePtr changeMode(Mode) const; ReferencePtr changeSecure(bool) const; ReferencePtr changeEndpoints(const std::vector&) const; bool operator==(const Reference&) const; bool operator<(const Reference&) const; }; } #endif