http://git-wip-us.apache.org/repos/asf/geode-native/blob/fc9f1f6f/src/clicache/src/CacheFactory.hpp ---------------------------------------------------------------------- diff --git a/src/clicache/src/CacheFactory.hpp b/src/clicache/src/CacheFactory.hpp index d422be2..393cc0b 100644 --- a/src/clicache/src/CacheFactory.hpp +++ b/src/clicache/src/CacheFactory.hpp @@ -54,7 +54,7 @@ namespace Apache /// This should be called once. Using this one can set default values of <see cref="Pool" />. /// </summary> /// <param name="dsProps">Properties which are applicable at client level.</param> - // static CacheFactory^ CreateCacheFactory(Dictionary<Object^, Object^>^ dsProps); + // static CacheFactory^ CreateCacheFactory(Dictionary<Object^, Object^>^ dsProps); static CacheFactory^ CreateCacheFactory(Properties<String^, String^>^ dsProps); /// <summary> @@ -86,7 +86,7 @@ namespace Apache /// <exception cref="EntryNotFoundException"> /// if a cache with specified system not found /// </exception> - static Cache^ GetInstance( DistributedSystem^ system ); + static Cache^ GetInstance(DistributedSystem^ system); /// <summary> /// Gets the instance of <see cref="Cache" /> produced by an @@ -107,7 +107,7 @@ namespace Apache /// <exception cref="EntryNotFoundException"> /// if a cache with specified system not found /// </exception> - static Cache^ GetInstanceCloseOk( DistributedSystem^ system ); + static Cache^ GetInstanceCloseOk(DistributedSystem^ system); /// <summary> /// Gets an arbitrary open instance of <see cref="Cache" /> produced by an @@ -120,24 +120,24 @@ namespace Apache /// <exception cref="EntryNotFoundException"> /// if a cache with specified system not found /// </exception> - static Cache^ GetAnyInstance( ); + static Cache^ GetAnyInstance(); /// <summary> /// Set allocators for non default Microsoft CRT versions. /// </summary> static void SetNewAndDelete() { - apache::geode::client::setNewAndDelete( & operator new, & operator delete ); + apache::geode::client::setNewAndDelete(&operator new, &operator delete); } /// <summary> /// Returns the version of the cache implementation. - /// For the 1.0 release of GemFire, the string returned is <c>1.0</c>. + /// For the 1.0 release of Geode, the string returned is <c>1.0</c>. /// </summary> /// <returns>the version of the cache implementation as a <c>String</c></returns> static property String^ Version { - static String^ get( ); + static String^ get(); } /// <summary> @@ -145,464 +145,464 @@ namespace Apache /// </summary> static property String^ ProductDescription { - static String^ get( ); + static String^ get(); } - /// <summary> - /// Sets the free connection timeout for this pool. - /// </summary> - /// <remarks> - /// If the pool has a max connections setting, operations will block - /// if all of the connections are in use. The free connection timeout - /// specifies how long those operations will block waiting for - /// a free connection before receiving an AllConnectionsInUseException. - /// If max connections is not set this setting has no effect. - /// </remarks> - /// <param> - /// connectionTimeout the connection timeout in milliseconds - /// </param> - /// <exception> - /// IllegalArgumentException if connectionTimeout - /// is less than or equal to 0. - /// </exception> - CacheFactory^ SetFreeConnectionTimeout( Int32 connectionTimeout ); - - /// <summary> - /// Sets the load conditioning interval for this pool. - /// </summary> - /// <remarks> - /// This interval controls how frequently the pool will check to see if - /// a connection to a given server should be moved to a different - /// server to improve the load balance. - /// </remarks> - /// <param> - /// loadConditioningInterval the connection lifetime in milliseconds - /// A value of -1 disables load conditioning. - /// </param> - /// <exception> - /// throws IllegalArgumentException if connectionLifetime - /// is less than -1. - /// </exception> - /// <returns> - /// a instance of <c>CacheFactory</c> - /// </returns> - CacheFactory^ SetLoadConditioningInterval( Int32 loadConditioningInterval ); - - /// <summary> - /// Sets the socket buffer size for each connection made in this pool. - /// </summary> - /// <remarks> - /// Large messages can be received and sent faster when this buffer is larger. - /// Larger buffers also optimize the rate at which servers can send events - /// for client subscriptions. - /// </remarks> - /// <param> - /// bufferSize the size of the socket buffers used for reading and - /// writing on each connection in this pool. - /// </param> - /// <exception> - /// throws IllegalArgumentException if bufferSize - /// is less than or equal to 0. - /// </exception> - /// <returns> - /// a instance of <c>CacheFactory</c> - /// </returns> - CacheFactory^ SetSocketBufferSize( Int32 bufferSize ); - - /// <summary> - /// Sets the number of milliseconds to wait for a response from a server before - /// timing out the operation and trying another server (if any are available). - /// </summary> - /// <param> - /// timeout number of milliseconds to wait for a response from a server - /// </param> - /// <exception> - /// throws IllegalArgumentException if timeout - /// is less than or equal to 0. - /// </exception> - /// <returns> - /// a instance of <c>CacheFactory</c> - /// </returns> - CacheFactory^ SetReadTimeout( Int32 timeout ); - - /// <summary> - /// Set the minimum number of connections to keep available at all times. - /// </summary> - /// <remarks> - /// When the pool is created, it will create this many connections. - /// If 0 then connections will not be made until an actual operation - /// is done that requires client-to-server communication. - /// </remarks> - /// <param> - /// minConnections the initial number of connections this pool will create. - /// </param> - /// <exception> - /// throws IllegalArgumentException if minConnections is less than 0. - /// </exception> - /// <returns> - /// a instance of <c>CacheFactory</c> - /// </returns> - CacheFactory^ SetMinConnections( Int32 minConnections ); - - /// <summary> - /// Set the max number of client to server connections that the pool will create. - /// </summary> - /// <remarks> - /// If all of the connections are in use, an operation requiring a client to - /// server connection will block until a connection is available. - /// see setFreeConnectionTimeout(int) - /// </remarks> - /// <param> - /// maxConnections the maximum number of connections in the pool. - /// -1 indicates that there is no maximum number of connections. - /// </param> - /// <exception> - /// throws IllegalArgumentException if maxConnections is less than minConnections. - /// </exception> - /// <returns> - /// a instance of <c>CacheFactory</c> - /// </returns> - CacheFactory^ SetMaxConnections( Int32 maxConnections ); - - /// <summary> - /// Set the amount of time a connection can be idle before expiring the connection. - /// </summary> - /// <remarks> - /// If the pool size is greater than the minimum specified, connections which have - /// been idle for longer than the idleTimeout will be closed. - /// </remarks> - /// <param> - /// idleTimeout The amount of time in milliseconds that an idle connection - /// should live before expiring. -1 indicates that connections should never expire. - /// </param> - /// <exception> - /// throws IllegalArgumentException if idleTimout is less than 0. - /// </exception> - /// <returns> - /// a instance of <c>CacheFactory</c> - /// </returns> - CacheFactory^ SetIdleTimeout( Int32 idleTimeout ); - - /// <summary> - /// Set the number of times to retry a request after timeout/exception. - /// </summary> - /// <param> - /// retryAttempts The number of times to retry a request - /// after timeout/exception. -1 indicates that a request should be - /// tried against every available server before failing. - /// </param> - /// <exception> - /// throws IllegalArgumentException if idleTimout is less than 0. - /// </exception> - /// <returns> - /// a instance of <c>CacheFactory</c> - /// </returns> - CacheFactory^ SetRetryAttempts( Int32 retryAttempts ); - - /// <summary> - /// Set how often to ping servers to verify that they are still alive. - /// </summary> - /// <remarks> - /// Each server will be sent a ping every pingInterval if there has not - /// been any other communication with the server. - /// These pings are used by the server to monitor the health of - /// the client. Make sure that the pingInterval is less than the - /// maximum time between pings allowed by the bridge server. - /// see in CacheServer: setMaximumTimeBetweenPings(int) - /// </remarks> - /// <param> - /// pingInterval The amount of time in milliseconds between pings. - /// </param> - /// <exception> - /// throws IllegalArgumentException if pingInterval is less than 0. - /// </exception> - /// <returns> - /// a instance of <c>CacheFactory</c> - /// </returns> - CacheFactory^ SetPingInterval( Int32 pingInterval ); + /// <summary> + /// Sets the free connection timeout for this pool. + /// </summary> + /// <remarks> + /// If the pool has a max connections setting, operations will block + /// if all of the connections are in use. The free connection timeout + /// specifies how long those operations will block waiting for + /// a free connection before receiving an AllConnectionsInUseException. + /// If max connections is not set this setting has no effect. + /// </remarks> + /// <param> + /// connectionTimeout the connection timeout in milliseconds + /// </param> + /// <exception> + /// IllegalArgumentException if connectionTimeout + /// is less than or equal to 0. + /// </exception> + CacheFactory^ SetFreeConnectionTimeout(Int32 connectionTimeout); - /// <summary> - /// Set how often to update locator list from locator - /// </summary> - /// <param> - /// updateLocatorListInterval The amount of time in milliseconds between - /// updating locator list. If its set to 0 then client will not update - /// the locator list. - /// </param> - /// <returns> - /// a instance of <c>CacheFactory</c> - /// </returns> - CacheFactory^ SetUpdateLocatorListInterval( Int32 updateLocatorListInterval ); - - - /// <summary> - /// Set how often to send client statistics to the server. - /// </summary> - /// <remarks> - /// Doing this allows gfmon to monitor clients. - /// A value of -1 disables the sending of client statistics - /// to the server. - /// </remarks> - /// <param> - /// statisticInterval The amount of time in milliseconds between - /// sends of client statistics to the server. - /// </param> - /// <exception> - /// throws IllegalArgumentException if statisticInterval - /// is less than -1. - /// </exception> - /// <returns> - /// a instance of <c>CacheFactory</c> - /// </returns> - CacheFactory^ SetStatisticInterval( Int32 statisticInterval); - - /// <summary> - /// Configures the group that all servers this pool connects to must belong to. - /// </summary> - /// <param> - /// group the server group that this pool will connect to. - /// If null or "" then all servers will be connected to. - /// </param> - /// <returns> - /// a instance of <c>CacheFactory</c> - /// </returns> - CacheFactory^ SetServerGroup( String^ group ); - - /// <summary> - /// Add a locator, given its host and port, to this factory. - /// </summary> - /// <remarks> - /// The locator must be a server locator and will be used to discover other running - /// bridge servers and locators. - /// </remarks> - /// <param> - /// host the host name or ip address that the locator is listening on. - /// </param> - /// <param> - /// port the port that the locator is listening on - /// </param> - /// <exception> - /// throws IllegalArgumentException if host is an unknown host - /// or if port is outside the valid range of [1..65535] inclusive. - /// </exception> - /// <exception> - /// throws IllegalStateException if a locator has already been added to this factory. - /// </exception> - /// <returns> - /// a instance of <c>CacheFactory</c> - /// </returns> - CacheFactory^ AddLocator( String^ host, Int32 port ); - - /// <summary> - /// Add a server, given its host and port, to this factory. - /// </summary> - /// <remarks> - /// The server must be a bridge server and this client will - /// directly connect to without consulting a server locator. - /// </remarks> - /// <param> - /// host the host name or ip address that the server is listening on. - /// </param> - /// <param> - /// port the port that the server is listening on - /// </param> - /// <exception> - /// throws IllegalArgumentException if host is an unknown host - /// or if port is outside the valid range of [1..65535] inclusive. - /// </exception> - /// <exception> - /// throws IllegalStateException if a server has already been added to this factory. - /// </exception> - /// <returns> - /// a instance of <c>CacheFactory</c> - /// </returns> - CacheFactory^ AddServer( String^ host, Int32 port ); - - /// <summary> - /// Enable subscriptions. - /// </summary> - /// <remarks> - /// If set to true then the created pool will have server-to-client - /// subscriptions enabled. If set to false then all Subscription* - /// attributes are ignored at create time. - /// </remarks> - /// <returns> - /// a instance of <c>CacheFactory</c> - /// </returns> - CacheFactory^ SetSubscriptionEnabled( Boolean enabled ); + /// <summary> + /// Sets the load conditioning interval for this pool. + /// </summary> + /// <remarks> + /// This interval controls how frequently the pool will check to see if + /// a connection to a given server should be moved to a different + /// server to improve the load balance. + /// </remarks> + /// <param> + /// loadConditioningInterval the connection lifetime in milliseconds + /// A value of -1 disables load conditioning. + /// </param> + /// <exception> + /// throws IllegalArgumentException if connectionLifetime + /// is less than -1. + /// </exception> + /// <returns> + /// a instance of <c>CacheFactory</c> + /// </returns> + CacheFactory^ SetLoadConditioningInterval(Int32 loadConditioningInterval); - /// <summary> - /// By default SetPRSingleHopEnabled is true. - /// </summary> - /// <remarks> - /// The client is aware of location of partitions on servers hosting - /// Using this information, the client routes the client cache operations - /// directly to the server which is hosting the required partition for the - /// cache operation. - /// If SetPRSingleHopEnabled is false the client can do an extra hop on servers - /// to go to the required partition for that cache operation. - /// The SetPRSingleHopEnabled avoids extra hops only for following cache operations : - /// put, get & destroy operations. - /// </remarks> - /// <returns> - /// a instance of <c>CacheFactory</c> - /// </returns> - CacheFactory^ SetPRSingleHopEnabled( Boolean enabled ); - - /// <summary> - /// Sets the redundancy level for this pools server-to-client subscriptions. - /// </summary> - /// <remarks> - /// If 0 then no redundant copies will be kept on the servers. - /// Otherwise an effort will be made to maintain the requested number of - /// copies of the server-to-client subscriptions. At most one copy per server will - /// be made up to the requested level. - /// </remarks> - /// <param> - /// redundancy the number of redundant servers for this client's subscriptions. - /// </param> - /// <exception> - /// throws IllegalArgumentException if redundancyLevel is less than -1. - /// </exception> - /// <returns> - /// a instance of <c>CacheFactory</c> - /// </returns> - CacheFactory^ SetSubscriptionRedundancy( Int32 redundancy ); - - /// <summary> - /// Sets the messageTrackingTimeout attribute which is the time-to-live period, - /// in milliseconds, for subscription events the client has received from the server. - /// </summary> - /// <remarks> - /// It's used to minimize duplicate events. Entries that have not been modified - /// for this amount of time are expired from the list. - /// </remarks> - /// <param> - /// messageTrackingTimeout number of milliseconds to set the timeout to. - /// </param> - /// <exception> - /// throws IllegalArgumentException if messageTrackingTimeout is less than or equal to 0. - /// </exception> - /// <returns> - /// a instance of <c>CacheFactory</c> - /// </returns> - CacheFactory^ SetSubscriptionMessageTrackingTimeout( Int32 messageTrackingTimeout ); - - /// <summary> - /// Sets the is the interval in milliseconds to wait before sending - /// acknowledgements to the bridge server for events received from the server subscriptions. - /// </summary> - /// <param> - /// ackInterval number of milliseconds to wait before sending event acknowledgements. - /// </param> - /// <exception> - /// throws IllegalArgumentException if ackInterval is less than or equal to 0. - /// </exception> - /// <returns> - /// a instance of <c>CacheFactory</c> - /// </returns> - CacheFactory^ SetSubscriptionAckInterval( Int32 ackInterval ); + /// <summary> + /// Sets the socket buffer size for each connection made in this pool. + /// </summary> + /// <remarks> + /// Large messages can be received and sent faster when this buffer is larger. + /// Larger buffers also optimize the rate at which servers can send events + /// for client subscriptions. + /// </remarks> + /// <param> + /// bufferSize the size of the socket buffers used for reading and + /// writing on each connection in this pool. + /// </param> + /// <exception> + /// throws IllegalArgumentException if bufferSize + /// is less than or equal to 0. + /// </exception> + /// <returns> + /// a instance of <c>CacheFactory</c> + /// </returns> + CacheFactory^ SetSocketBufferSize(Int32 bufferSize); - /// <summary> - /// Enable thread local connections. - /// </summary> - /// <remarks> - /// Sets the thread local connections policy for the default connection pool. - /// If true then any time a thread goes to use a connection - /// from this pool it will check a thread local cache and see if it already - /// has a connection in it. If so it will use it. If not it will get one from - /// this pool and cache it in the thread local. This gets rid of thread contention - /// for the connections but increases the number of connections the servers see. - /// If false then connections are returned to the pool as soon - /// as the operation being done with the connection completes. This allows - /// connections to be shared amonst multiple threads keeping the number of - /// connections down. - /// </remarks> - CacheFactory^ SetThreadLocalConnections( bool enabled ); + /// <summary> + /// Sets the number of milliseconds to wait for a response from a server before + /// timing out the operation and trying another server (if any are available). + /// </summary> + /// <param> + /// timeout number of milliseconds to wait for a response from a server + /// </param> + /// <exception> + /// throws IllegalArgumentException if timeout + /// is less than or equal to 0. + /// </exception> + /// <returns> + /// a instance of <c>CacheFactory</c> + /// </returns> + CacheFactory^ SetReadTimeout(Int32 timeout); - /// <summary> - /// Sets whether pool is in multiuser mode - /// </summary> - /// <param> - /// multiuserAuthentication should be true/false. Default value is false; - /// </param> - /// <returns> - /// a instance of <c>CacheFactory</c> - /// </returns> - CacheFactory^ SetMultiuserAuthentication( bool multiuserAuthentication ); - - - ///<summary> - /// Control whether pdx ignores fields that were unread during deserialization. - /// The default is to preserve unread fields be including their data during serialization. - /// But if you configure the cache to ignore unread fields then their data will be lost - /// during serialization. - /// <P>You should only set this attribute to <code>true</code> if you know this member - /// will only be reading cache data. In this use case you do not need to pay the cost - /// of preserving the unread fields since you will never be reserializing pdx data. - ///<summary> - /// <param> ignore <code>true</code> if fields not read during pdx deserialization should be ignored; - /// <code>false</code>, the default, if they should be preserved. - /// </param> - /// <returns> - /// a instance of <c>CacheFactory</c> - /// </returns> - CacheFactory^ SetPdxIgnoreUnreadFields(bool ignore); - - ///<summary> - /// Sets the object preference to PdxInstance type. - /// When a cached object that was serialized as a PDX is read - /// from the cache a {@link PdxInstance} will be returned instead of the actual domain class. - /// The PdxInstance is an interface that provides run time access to - /// the fields of a PDX without deserializing the entire PDX. - /// The PdxInstance implementation is a light weight wrapper - /// that simply refers to the raw bytes of the PDX that are kept - /// in the cache. Using this method applications can choose to - /// access PdxInstance instead of Java object. - /// Note that a PdxInstance is only returned if a serialized PDX is found in the cache. - /// If the cache contains a deserialized PDX, then a domain class instance is returned instead of a PdxInstance. - ///</summary> - /// <param> pdxReadSerialized <code>true</code> to prefer PdxInstance - /// <code>false</code>, the default, if they should be preserved. - /// </param> - /// <returns> - /// a instance of <c>CacheFactory</c> - /// </returns> - CacheFactory^ SetPdxReadSerialized(bool pdxReadSerialized); + /// <summary> + /// Set the minimum number of connections to keep available at all times. + /// </summary> + /// <remarks> + /// When the pool is created, it will create this many connections. + /// If 0 then connections will not be made until an actual operation + /// is done that requires client-to-server communication. + /// </remarks> + /// <param> + /// minConnections the initial number of connections this pool will create. + /// </param> + /// <exception> + /// throws IllegalArgumentException if minConnections is less than 0. + /// </exception> + /// <returns> + /// a instance of <c>CacheFactory</c> + /// </returns> + CacheFactory^ SetMinConnections(Int32 minConnections); + + /// <summary> + /// Set the max number of client to server connections that the pool will create. + /// </summary> + /// <remarks> + /// If all of the connections are in use, an operation requiring a client to + /// server connection will block until a connection is available. + /// see setFreeConnectionTimeout(int) + /// </remarks> + /// <param> + /// maxConnections the maximum number of connections in the pool. + /// -1 indicates that there is no maximum number of connections. + /// </param> + /// <exception> + /// throws IllegalArgumentException if maxConnections is less than minConnections. + /// </exception> + /// <returns> + /// a instance of <c>CacheFactory</c> + /// </returns> + CacheFactory^ SetMaxConnections(Int32 maxConnections); + + /// <summary> + /// Set the amount of time a connection can be idle before expiring the connection. + /// </summary> + /// <remarks> + /// If the pool size is greater than the minimum specified, connections which have + /// been idle for longer than the idleTimeout will be closed. + /// </remarks> + /// <param> + /// idleTimeout The amount of time in milliseconds that an idle connection + /// should live before expiring. -1 indicates that connections should never expire. + /// </param> + /// <exception> + /// throws IllegalArgumentException if idleTimout is less than 0. + /// </exception> + /// <returns> + /// a instance of <c>CacheFactory</c> + /// </returns> + CacheFactory^ SetIdleTimeout(Int32 idleTimeout); + /// <summary> + /// Set the number of times to retry a request after timeout/exception. + /// </summary> + /// <param> + /// retryAttempts The number of times to retry a request + /// after timeout/exception. -1 indicates that a request should be + /// tried against every available server before failing. + /// </param> + /// <exception> + /// throws IllegalArgumentException if idleTimout is less than 0. + /// </exception> + /// <returns> + /// a instance of <c>CacheFactory</c> + /// </returns> + CacheFactory^ SetRetryAttempts(Int32 retryAttempts); + + /// <summary> + /// Set how often to ping servers to verify that they are still alive. + /// </summary> + /// <remarks> + /// Each server will be sent a ping every pingInterval if there has not + /// been any other communication with the server. + /// These pings are used by the server to monitor the health of + /// the client. Make sure that the pingInterval is less than the + /// maximum time between pings allowed by the bridge server. + /// see in CacheServer: setMaximumTimeBetweenPings(int) + /// </remarks> + /// <param> + /// pingInterval The amount of time in milliseconds between pings. + /// </param> + /// <exception> + /// throws IllegalArgumentException if pingInterval is less than 0. + /// </exception> + /// <returns> + /// a instance of <c>CacheFactory</c> + /// </returns> + CacheFactory^ SetPingInterval(Int32 pingInterval); + + /// <summary> + /// Set how often to update locator list from locator + /// </summary> + /// <param> + /// updateLocatorListInterval The amount of time in milliseconds between + /// updating locator list. If its set to 0 then client will not update + /// the locator list. + /// </param> + /// <returns> + /// a instance of <c>CacheFactory</c> + /// </returns> + CacheFactory^ SetUpdateLocatorListInterval(Int32 updateLocatorListInterval); - /// <summary> - /// Sets a gemfire property that will be used when creating the ClientCache. - /// </summary> - /// <param> - /// name the name of the gemfire property - /// </param> - /// <param> - /// value the value of the gemfire property - /// </param> - /// <returns> - /// a instance of <c>CacheFactory</c> - /// </returns> - CacheFactory^ Set(String^ name, String^ value); - private: + /// <summary> + /// Set how often to send client statistics to the server. + /// </summary> + /// <remarks> + /// Doing this allows gfmon to monitor clients. + /// A value of -1 disables the sending of client statistics + /// to the server. + /// </remarks> + /// <param> + /// statisticInterval The amount of time in milliseconds between + /// sends of client statistics to the server. + /// </param> + /// <exception> + /// throws IllegalArgumentException if statisticInterval + /// is less than -1. + /// </exception> + /// <returns> + /// a instance of <c>CacheFactory</c> + /// </returns> + CacheFactory^ SetStatisticInterval(Int32 statisticInterval); + + /// <summary> + /// Configures the group that all servers this pool connects to must belong to. + /// </summary> + /// <param> + /// group the server group that this pool will connect to. + /// If null or "" then all servers will be connected to. + /// </param> + /// <returns> + /// a instance of <c>CacheFactory</c> + /// </returns> + CacheFactory^ SetServerGroup(String^ group); + + /// <summary> + /// Add a locator, given its host and port, to this factory. + /// </summary> + /// <remarks> + /// The locator must be a server locator and will be used to discover other running + /// bridge servers and locators. + /// </remarks> + /// <param> + /// host the host name or ip address that the locator is listening on. + /// </param> + /// <param> + /// port the port that the locator is listening on + /// </param> + /// <exception> + /// throws IllegalArgumentException if host is an unknown host + /// or if port is outside the valid range of [1..65535] inclusive. + /// </exception> + /// <exception> + /// throws IllegalStateException if a locator has already been added to this factory. + /// </exception> + /// <returns> + /// a instance of <c>CacheFactory</c> + /// </returns> + CacheFactory^ AddLocator(String^ host, Int32 port); + + /// <summary> + /// Add a server, given its host and port, to this factory. + /// </summary> + /// <remarks> + /// The server must be a bridge server and this client will + /// directly connect to without consulting a server locator. + /// </remarks> + /// <param> + /// host the host name or ip address that the server is listening on. + /// </param> + /// <param> + /// port the port that the server is listening on + /// </param> + /// <exception> + /// throws IllegalArgumentException if host is an unknown host + /// or if port is outside the valid range of [1..65535] inclusive. + /// </exception> + /// <exception> + /// throws IllegalStateException if a server has already been added to this factory. + /// </exception> + /// <returns> + /// a instance of <c>CacheFactory</c> + /// </returns> + CacheFactory^ AddServer(String^ host, Int32 port); + + /// <summary> + /// Enable subscriptions. + /// </summary> + /// <remarks> + /// If set to true then the created pool will have server-to-client + /// subscriptions enabled. If set to false then all Subscription* + /// attributes are ignored at create time. + /// </remarks> + /// <returns> + /// a instance of <c>CacheFactory</c> + /// </returns> + CacheFactory^ SetSubscriptionEnabled(Boolean enabled); + + /// <summary> + /// By default SetPRSingleHopEnabled is true. + /// </summary> + /// <remarks> + /// The client is aware of location of partitions on servers hosting + /// Using this information, the client routes the client cache operations + /// directly to the server which is hosting the required partition for the + /// cache operation. + /// If SetPRSingleHopEnabled is false the client can do an extra hop on servers + /// to go to the required partition for that cache operation. + /// The SetPRSingleHopEnabled avoids extra hops only for following cache operations : + /// put, get & destroy operations. + /// </remarks> + /// <returns> + /// a instance of <c>CacheFactory</c> + /// </returns> + CacheFactory^ SetPRSingleHopEnabled(Boolean enabled); + + /// <summary> + /// Sets the redundancy level for this pools server-to-client subscriptions. + /// </summary> + /// <remarks> + /// If 0 then no redundant copies will be kept on the servers. + /// Otherwise an effort will be made to maintain the requested number of + /// copies of the server-to-client subscriptions. At most one copy per server will + /// be made up to the requested level. + /// </remarks> + /// <param> + /// redundancy the number of redundant servers for this client's subscriptions. + /// </param> + /// <exception> + /// throws IllegalArgumentException if redundancyLevel is less than -1. + /// </exception> + /// <returns> + /// a instance of <c>CacheFactory</c> + /// </returns> + CacheFactory^ SetSubscriptionRedundancy(Int32 redundancy); + + /// <summary> + /// Sets the messageTrackingTimeout attribute which is the time-to-live period, + /// in milliseconds, for subscription events the client has received from the server. + /// </summary> + /// <remarks> + /// It's used to minimize duplicate events. Entries that have not been modified + /// for this amount of time are expired from the list. + /// </remarks> + /// <param> + /// messageTrackingTimeout number of milliseconds to set the timeout to. + /// </param> + /// <exception> + /// throws IllegalArgumentException if messageTrackingTimeout is less than or equal to 0. + /// </exception> + /// <returns> + /// a instance of <c>CacheFactory</c> + /// </returns> + CacheFactory^ SetSubscriptionMessageTrackingTimeout(Int32 messageTrackingTimeout); + + /// <summary> + /// Sets the is the interval in milliseconds to wait before sending + /// acknowledgements to the bridge server for events received from the server subscriptions. + /// </summary> + /// <param> + /// ackInterval number of milliseconds to wait before sending event acknowledgements. + /// </param> + /// <exception> + /// throws IllegalArgumentException if ackInterval is less than or equal to 0. + /// </exception> + /// <returns> + /// a instance of <c>CacheFactory</c> + /// </returns> + CacheFactory^ SetSubscriptionAckInterval(Int32 ackInterval); + + /// <summary> + /// Enable thread local connections. + /// </summary> + /// <remarks> + /// Sets the thread local connections policy for the default connection pool. + /// If true then any time a thread goes to use a connection + /// from this pool it will check a thread local cache and see if it already + /// has a connection in it. If so it will use it. If not it will get one from + /// this pool and cache it in the thread local. This gets rid of thread contention + /// for the connections but increases the number of connections the servers see. + /// If false then connections are returned to the pool as soon + /// as the operation being done with the connection completes. This allows + /// connections to be shared amonst multiple threads keeping the number of + /// connections down. + /// </remarks> + CacheFactory^ SetThreadLocalConnections(bool enabled); + + /// <summary> + /// Sets whether pool is in multiuser mode + /// </summary> + /// <param> + /// multiuserAuthentication should be true/false. Default value is false; + /// </param> + /// <returns> + /// a instance of <c>CacheFactory</c> + /// </returns> + CacheFactory^ SetMultiuserAuthentication(bool multiuserAuthentication); + + + ///<summary> + /// Control whether pdx ignores fields that were unread during deserialization. + /// The default is to preserve unread fields be including their data during serialization. + /// But if you configure the cache to ignore unread fields then their data will be lost + /// during serialization. + /// <P>You should only set this attribute to <code>true</code> if you know this member + /// will only be reading cache data. In this use case you do not need to pay the cost + /// of preserving the unread fields since you will never be reserializing pdx data. + ///<summary> + /// <param> ignore <code>true</code> if fields not read during pdx deserialization should be ignored; + /// <code>false</code>, the default, if they should be preserved. + /// </param> + /// <returns> + /// a instance of <c>CacheFactory</c> + /// </returns> + CacheFactory^ SetPdxIgnoreUnreadFields(bool ignore); + + ///<summary> + /// Sets the object preference to PdxInstance type. + /// When a cached object that was serialized as a PDX is read + /// from the cache a {@link PdxInstance} will be returned instead of the actual domain class. + /// The PdxInstance is an interface that provides run time access to + /// the fields of a PDX without deserializing the entire PDX. + /// The PdxInstance implementation is a light weight wrapper + /// that simply refers to the raw bytes of the PDX that are kept + /// in the cache. Using this method applications can choose to + /// access PdxInstance instead of Java object. + /// Note that a PdxInstance is only returned if a serialized PDX is found in the cache. + /// If the cache contains a deserialized PDX, then a domain class instance is returned instead of a PdxInstance. + ///</summary> + /// <param> pdxReadSerialized <code>true</code> to prefer PdxInstance + /// <code>false</code>, the default, if they should be preserved. + /// </param> + /// <returns> + /// a instance of <c>CacheFactory</c> + /// </returns> + CacheFactory^ SetPdxReadSerialized(bool pdxReadSerialized); + + + /// <summary> + /// Sets a geode property that will be used when creating the ClientCache. + /// </summary> + /// <param> + /// name the name of the geode property + /// </param> + /// <param> + /// value the value of the geode property + /// </param> + /// <returns> + /// a instance of <c>CacheFactory</c> + /// </returns> + CacheFactory^ Set(String^ name, String^ value); + + private: /// <summary> /// Private constructor to wrap a native object pointer /// </summary> /// <param name="nativeptr">The native object pointer</param> - inline CacheFactory( apache::geode::client::CacheFactory* nativeptr, Properties<String^, String^>^ dsProps ) - : SBWrap( nativeptr ) - { - m_dsProps = dsProps; - } + inline CacheFactory(apache::geode::client::CacheFactory* nativeptr, Properties<String^, String^>^ dsProps) + : SBWrap(nativeptr) + { + m_dsProps = dsProps; + } - Properties<String^, String^>^ m_dsProps; + Properties<String^, String^>^ m_dsProps; - static System::Object^ m_singletonSync = gcnew System::Object(); + static System::Object^ m_singletonSync = gcnew System::Object(); - internal: - static bool m_connected = false; + internal: + static bool m_connected = false; }; } // namespace Client } // namespace Geode
http://git-wip-us.apache.org/repos/asf/geode-native/blob/fc9f1f6f/src/clicache/src/CacheableArrayList.hpp ---------------------------------------------------------------------- diff --git a/src/clicache/src/CacheableArrayList.hpp b/src/clicache/src/CacheableArrayList.hpp index 3ac12a8..31336f2 100644 --- a/src/clicache/src/CacheableArrayList.hpp +++ b/src/clicache/src/CacheableArrayList.hpp @@ -47,7 +47,7 @@ namespace Apache : CacheableVector(list) { } - + /// <summary> /// Static function to create a new empty instance. /// </summary> @@ -64,7 +64,7 @@ namespace Apache return gcnew CacheableArrayList(list); } - + // Region: IGFSerializable Members /// <summary> @@ -77,7 +77,7 @@ namespace Apache { virtual uint32_t get() override { - return GemFireClassIds::CacheableArrayList; + return GeodeClassIds::CacheableArrayList; } } http://git-wip-us.apache.org/repos/asf/geode-native/blob/fc9f1f6f/src/clicache/src/CacheableBuiltins.hpp ---------------------------------------------------------------------- diff --git a/src/clicache/src/CacheableBuiltins.hpp b/src/clicache/src/CacheableBuiltins.hpp index 21ab7da..48f7f90 100644 --- a/src/clicache/src/CacheableBuiltins.hpp +++ b/src/clicache/src/CacheableBuiltins.hpp @@ -24,7 +24,7 @@ #include "CacheableKey.hpp" #include "Serializable.hpp" #include "ExceptionTypes.hpp" -#include "GemFireClassIds.hpp" +#include "GeodeClassIds.hpp" #include "DataOutput.hpp" #include "DataInput.hpp" @@ -38,280 +38,280 @@ namespace Apache { //namespace Internal - + + /// <summary> + /// An immutable template wrapper for C++ <c>CacheableKey</c>s that can + /// serve as a distributable key object for caching. + /// </summary> + template <typename TNative, typename TManaged, uint32_t TYPEID> + ref class CacheableBuiltinKey + : public CacheableKey + { + public: /// <summary> - /// An immutable template wrapper for C++ <c>CacheableKey</c>s that can - /// serve as a distributable key object for caching. + /// Allocates a new instance /// </summary> - template <typename TNative, typename TManaged, uint32_t TYPEID> - ref class CacheableBuiltinKey - : public CacheableKey + CacheableBuiltinKey() { - public: - /// <summary> - /// Allocates a new instance - /// </summary> - CacheableBuiltinKey() - { - apache::geode::client::SharedPtr<TNative>& nativeptr = TNative::create(); + apache::geode::client::SharedPtr<TNative>& nativeptr = TNative::create(); - SetSP(nativeptr.ptr()); - } + SetSP(nativeptr.ptr()); + } - /// <summary> - /// Allocates a new instance with the given value. - /// </summary> - /// <param name="value">the value of the new instance</param> - CacheableBuiltinKey(TManaged value) - { - apache::geode::client::SharedPtr<TNative>& nativeptr = TNative::create(value); + /// <summary> + /// Allocates a new instance with the given value. + /// </summary> + /// <param name="value">the value of the new instance</param> + CacheableBuiltinKey(TManaged value) + { + apache::geode::client::SharedPtr<TNative>& nativeptr = TNative::create(value); - SetSP(nativeptr.ptr()); - } + SetSP(nativeptr.ptr()); + } - /// <summary> - /// Returns the classId of the instance being serialized. - /// This is used by deserialization to determine what instance - /// type to create and deserialize into. - /// </summary> - /// <returns>the classId</returns> - virtual property uint32_t ClassId + /// <summary> + /// Returns the classId of the instance being serialized. + /// This is used by deserialization to determine what instance + /// type to create and deserialize into. + /// </summary> + /// <returns>the classId</returns> + virtual property uint32_t ClassId + { + virtual uint32_t get() override { - virtual uint32_t get() override - { - return TYPEID; - } + return TYPEID; } + } - /// <summary> - /// Return a string representation of the object. - /// This returns the string for the <c>Value</c> property. - /// </summary> - virtual String^ ToString() override - { - return static_cast<TNative*>(NativePtr())->value().ToString(); - } + /// <summary> + /// Return a string representation of the object. + /// This returns the string for the <c>Value</c> property. + /// </summary> + virtual String^ ToString() override + { + return static_cast<TNative*>(NativePtr())->value().ToString(); + } - /// <summary> - /// Return true if this key matches other object. - /// It invokes the '==' operator of the underlying - /// native object. - /// </summary> - virtual bool Equals(ICacheableKey^ other) override + /// <summary> + /// Return true if this key matches other object. + /// It invokes the '==' operator of the underlying + /// native object. + /// </summary> + virtual bool Equals(ICacheableKey^ other) override + { + if (other == nullptr || other->ClassId != TYPEID) { - if (other == nullptr || other->ClassId != TYPEID) - { - return false; - } - return static_cast<TNative*>(NativePtr())->operator==( - *static_cast<TNative*>(((CacheableKey^)other)->NativePtr())); + return false; } + return static_cast<TNative*>(NativePtr())->operator==( + *static_cast<TNative*>(((CacheableKey^)other)->NativePtr())); + } - /// <summary> - /// Return true if this key matches other object. - /// It invokes the '==' operator of the underlying - /// native object. - /// </summary> - virtual bool Equals(Object^ obj) override - { - CacheableBuiltinKey^ otherKey = - dynamic_cast<CacheableBuiltinKey^>(obj); + /// <summary> + /// Return true if this key matches other object. + /// It invokes the '==' operator of the underlying + /// native object. + /// </summary> + virtual bool Equals(Object^ obj) override + { + CacheableBuiltinKey^ otherKey = + dynamic_cast<CacheableBuiltinKey^>(obj); - if (otherKey != nullptr) { - return static_cast<TNative*>(NativePtr())->operator==( - *static_cast<TNative*>(otherKey->NativePtr())); - } - return false; + if (otherKey != nullptr) { + return static_cast<TNative*>(NativePtr())->operator==( + *static_cast<TNative*>(otherKey->NativePtr())); } + return false; + } - /// <summary> - /// Comparison operator against another value. - /// </summary> - bool operator == (TManaged other) - { - return (static_cast<TNative*>(NativePtr())->value() == other); - } + /// <summary> + /// Comparison operator against another value. + /// </summary> + bool operator == (TManaged other) + { + return (static_cast<TNative*>(NativePtr())->value() == other); + } - /// <summary> - /// Gets the value. - /// </summary> - property TManaged Value + /// <summary> + /// Gets the value. + /// </summary> + property TManaged Value + { + inline TManaged get() { - inline TManaged get() - { - return static_cast<TNative*>(NativePtr())->value(); - } + return static_cast<TNative*>(NativePtr())->value(); } + } - protected: + protected: - /// <summary> - /// Protected constructor to wrap a native object pointer - /// </summary> - /// <param name="nativeptr">The native object pointer</param> - inline CacheableBuiltinKey(apache::geode::client::Serializable* nativeptr) - : CacheableKey(nativeptr) { } - }; + /// <summary> + /// Protected constructor to wrap a native object pointer + /// </summary> + /// <param name="nativeptr">The native object pointer</param> + inline CacheableBuiltinKey(apache::geode::client::Serializable* nativeptr) + : CacheableKey(nativeptr) { } + }; + /// <summary> + /// An immutable template array wrapper that can serve as a + /// distributable object for caching. + /// </summary> + template <typename TNative, typename TNativePtr, typename TManaged, + uint32_t TYPEID> + ref class CacheableBuiltinArray + : public Serializable + { + public: + /// <summary> - /// An immutable template array wrapper that can serve as a - /// distributable object for caching. + /// Returns the classId of the instance being serialized. + /// This is used by deserialization to determine what instance + /// type to create and deserialize into. /// </summary> - template <typename TNative, typename TNativePtr, typename TManaged, - uint32_t TYPEID> - ref class CacheableBuiltinArray - : public Serializable + /// <returns>the classId</returns> + virtual property uint32_t ClassId { - public: - - /// <summary> - /// Returns the classId of the instance being serialized. - /// This is used by deserialization to determine what instance - /// type to create and deserialize into. - /// </summary> - /// <returns>the classId</returns> - virtual property uint32_t ClassId + virtual uint32_t get() override { - virtual uint32_t get() override - { - return TYPEID; - } + return TYPEID; } + } - virtual void ToData(DataOutput^ output) override - { - output->WriteObject(m_value); - } + virtual void ToData(DataOutput^ output) override + { + output->WriteObject(m_value); + } - virtual IGFSerializable^ FromData(DataInput^ input) override - { - input->ReadObject(m_value); - return this; - } + virtual IGFSerializable^ FromData(DataInput^ input) override + { + input->ReadObject(m_value); + return this; + } - virtual property uint32_t ObjectSize + virtual property uint32_t ObjectSize + { + virtual uint32_t get() override { - virtual uint32_t get() override - { - return (uint32_t) (m_value->Length) * sizeof(TManaged); - } + return (uint32_t)(m_value->Length) * sizeof(TManaged); } - /// <summary> - /// Returns a copy of the underlying array. - /// </summary> - property array<TManaged>^ Value + } + /// <summary> + /// Returns a copy of the underlying array. + /// </summary> + property array<TManaged>^ Value + { + inline array<TManaged>^ get() { - inline array<TManaged>^ get() - { - return m_value; - } + return m_value; } + } - /// <summary> - /// Returns the size of this array. - /// </summary> - property int32_t Length + /// <summary> + /// Returns the size of this array. + /// </summary> + property int32_t Length + { + inline int32_t get() { - inline int32_t get() - { - return m_value->Length; - } + return m_value->Length; } + } - virtual String^ ToString() override - { - return m_value->ToString(); - } + virtual String^ ToString() override + { + return m_value->ToString(); + } - /// <summary> - /// Returns the value at the given index. - /// </summary> - property TManaged GFINDEXER(int32_t) + /// <summary> + /// Returns the value at the given index. + /// </summary> + property TManaged GFINDEXER(int32_t) + { + inline TManaged get(int32_t index) { - inline TManaged get(int32_t index) - { - return m_value[index]; - } + return m_value[index]; } + } - protected: + protected: - array<TManaged>^ m_value; - /// <summary> - /// Protected constructor - /// </summary> - inline CacheableBuiltinArray() - { - //TODO: - //apache::geode::client::Serializable* sp = TNative::createDeserializable(); - //SetSP(sp); - } - - /// <summary> - /// Protected constructor to wrap a native object pointer - /// </summary> - /// <param name="nativeptr">The native object pointer</param> - inline CacheableBuiltinArray(apache::geode::client::Serializable* nptr) - : Serializable(nptr) - { - //TODO: ?? - // ManagedPtrWrap< apache::geode::client::Serializable, - // Internal::SBWrap<apache::geode::client::Serializable> > nptr = nativeptr; - TNative* nativeptr = static_cast<TNative*>(nptr); - int32_t len = nativeptr->length(); - if (len > 0) - { - array<TManaged>^ buffer = gcnew array<TManaged>(len); - pin_ptr<TManaged> pin_buffer = &buffer[0]; - - memcpy((void*)pin_buffer, nativeptr->value(), - len * sizeof(TManaged)); - m_value = buffer; - } - } + array<TManaged>^ m_value; + /// <summary> + /// Protected constructor + /// </summary> + inline CacheableBuiltinArray() + { + //TODO: + //apache::geode::client::Serializable* sp = TNative::createDeserializable(); + //SetSP(sp); + } - /// <summary> - /// Allocates a new instance copying from the given array. - /// </summary> - /// <remarks> - /// This method performs no argument checking which is the - /// responsibility of the caller. - /// </remarks> - /// <param name="buffer">the array to copy from</param> - CacheableBuiltinArray(array<TManaged>^ buffer) + /// <summary> + /// Protected constructor to wrap a native object pointer + /// </summary> + /// <param name="nativeptr">The native object pointer</param> + inline CacheableBuiltinArray(apache::geode::client::Serializable* nptr) + : Serializable(nptr) + { + //TODO: ?? + // ManagedPtrWrap< apache::geode::client::Serializable, + // Internal::SBWrap<apache::geode::client::Serializable> > nptr = nativeptr; + TNative* nativeptr = static_cast<TNative*>(nptr); + int32_t len = nativeptr->length(); + if (len > 0) { + array<TManaged>^ buffer = gcnew array<TManaged>(len); + pin_ptr<TManaged> pin_buffer = &buffer[0]; + + memcpy((void*)pin_buffer, nativeptr->value(), + len * sizeof(TManaged)); m_value = buffer; - //setting local value as well - //m_value = gcnew array<TManaged>(buffer->Length); - //System::Array::Copy(buffer, 0, m_value,0, buffer->Length); } + } - /// <summary> - /// Allocates a new instance copying given length from the - /// start of given array. - /// </summary> - /// <remarks> - /// This method performs no argument checking which is the - /// responsibility of the caller. - /// </remarks> - /// <param name="buffer">the array to copy from</param> - /// <param name="length">length of array from start to copy</param> - CacheableBuiltinArray(array<TManaged>^ buffer, int32_t length) - { - //TODO: - if (length > buffer->Length) { - length = buffer->Length; - } - //setting local value as well - m_value = gcnew array<TManaged>(length); - System::Array::Copy(buffer, 0, m_value,0, length); + /// <summary> + /// Allocates a new instance copying from the given array. + /// </summary> + /// <remarks> + /// This method performs no argument checking which is the + /// responsibility of the caller. + /// </remarks> + /// <param name="buffer">the array to copy from</param> + CacheableBuiltinArray(array<TManaged>^ buffer) + { + m_value = buffer; + //setting local value as well + //m_value = gcnew array<TManaged>(buffer->Length); + //System::Array::Copy(buffer, 0, m_value,0, buffer->Length); + } + + /// <summary> + /// Allocates a new instance copying given length from the + /// start of given array. + /// </summary> + /// <remarks> + /// This method performs no argument checking which is the + /// responsibility of the caller. + /// </remarks> + /// <param name="buffer">the array to copy from</param> + /// <param name="length">length of array from start to copy</param> + CacheableBuiltinArray(array<TManaged>^ buffer, int32_t length) + { + //TODO: + if (length > buffer->Length) { + length = buffer->Length; } - }; + //setting local value as well + m_value = gcnew array<TManaged>(length); + System::Array::Copy(buffer, 0, m_value, 0, length); + } + }; + - //n = native type @@ -319,7 +319,7 @@ namespace Apache //mt = managed type(bool, int) #define _GFCLI_CACHEABLE_KEY_DEF_NEW(n, m, mt) \ ref class m : public CacheableBuiltinKey<n, mt, \ - GemFireClassIds::m> \ + GeodeClassIds::m> \ { \ public: \ /** <summary> @@ -327,141 +327,141 @@ namespace Apache * </summary> * <param name="value">the value of the new instance</param> */ \ - inline m() \ - : CacheableBuiltinKey() { } \ - /** <summary> - * Allocates a new instance with the given value. - * </summary> - * <param name="value">the value of the new instance</param> - */ \ - inline m(mt value) \ + inline m() \ + : CacheableBuiltinKey() { } \ + /** <summary> + * Allocates a new instance with the given value. + * </summary> + * <param name="value">the value of the new instance</param> + */ \ + inline m(mt value) \ : CacheableBuiltinKey(value) { } \ - /** <summary> - * Static function to create a new instance given value. - * </summary> - * <param name="value">the value of the new instance</param> - */ \ - inline static m^ Create(mt value) \ - { \ - return gcnew m(value); \ - } \ - /** <summary> - * Explicit conversion operator to contained value type. - * </summary> - */ \ - inline static explicit operator mt (m^ value) \ - { \ - return value->Value; \ - } \ - \ - /** <summary> - * Factory function to register this class. - * </summary> - */ \ - static IGFSerializable^ CreateDeserializable() \ - { \ - return gcnew m(); \ - } \ - \ - internal: \ - static IGFSerializable^ Create(apache::geode::client::Serializable* obj) \ - { \ - return (obj != nullptr ? gcnew m(obj) : nullptr); \ - } \ - \ - private: \ - inline m(apache::geode::client::Serializable* nativeptr) \ - : CacheableBuiltinKey(nativeptr) { } \ + /** <summary> + * Static function to create a new instance given value. + * </summary> + * <param name="value">the value of the new instance</param> + */ \ + inline static m^ Create(mt value) \ + { \ + return gcnew m(value); \ + } \ + /** <summary> + * Explicit conversion operator to contained value type. + * </summary> + */ \ + inline static explicit operator mt (m^ value) \ + { \ + return value->Value; \ + } \ + \ + /** <summary> + * Factory function to register this class. + * </summary> + */ \ + static IGFSerializable^ CreateDeserializable() \ + { \ + return gcnew m(); \ + } \ + \ + internal: \ + static IGFSerializable^ Create(apache::geode::client::Serializable* obj) \ + { \ + return (obj != nullptr ? gcnew m(obj) : nullptr); \ + } \ + \ + private: \ + inline m(apache::geode::client::Serializable* nativeptr) \ + : CacheableBuiltinKey(nativeptr) { } \ }; #define _GFCLI_CACHEABLE_ARRAY_DEF_NEW(m, mt) \ ref class m : public CacheableBuiltinArray< \ - apache::geode::client::m, apache::geode::client::m##Ptr, mt, GemFireClassIds::m> \ - { \ + apache::geode::client::m, apache::geode::client::m##Ptr, mt, GeodeClassIds::m> \ + { \ public: \ /** <summary> - * Static function to create a new instance copying - * from the given array. - * </summary> - * <remarks> - * Providing a null or zero size array will return a null object. - * </remarks> - * <param name="value">the array to create the new instance</param> - */ \ - inline static m^ Create(array<mt>^ value) \ - { \ - return (value != nullptr /*&& value->Length > 0*/ ? \ - gcnew m(value) : nullptr); \ - } \ - /** <summary> - * Static function to create a new instance copying - * from the given array. - * </summary> - * <remarks> - * Providing a null or zero size array will return a null object. - * </remarks> - * <param name="value">the array to create the new instance</param> - */ \ - inline static m^ Create(array<mt>^ value, int32_t length) \ - { \ - return (value != nullptr && value->Length > 0 ? \ - gcnew m(value, length) : nullptr); \ - } \ - /** <summary> - * Explicit conversion operator to contained array type. - * </summary> - */ \ - inline static explicit operator array<mt>^ (m^ value) \ - { \ - return (value != nullptr ? value->Value : nullptr); \ - } \ - \ - /** <summary> - * Factory function to register this class. - * </summary> - */ \ - static IGFSerializable^ CreateDeserializable() \ - { \ - return gcnew m(); \ - } \ - \ - internal: \ - static IGFSerializable^ Create(apache::geode::client::Serializable* obj) \ - { \ - return (obj != nullptr ? gcnew m(obj) : nullptr); \ - } \ - \ - private: \ - /** <summary> - * Allocates a new instance - * </summary> - */ \ - inline m() \ - : CacheableBuiltinArray() { } \ - /** <summary> - * Allocates a new instance copying from the given array. - * </summary> - * <remarks> - * Providing a null or zero size array will return a null object. - * </remarks> - * <param name="value">the array to create the new instance</param> - */ \ - inline m(array<mt>^ value) \ - : CacheableBuiltinArray(value) { } \ - /** <summary> - * Allocates a new instance copying given length from the - * start of given array. - * </summary> - * <remarks> - * Providing a null or zero size array will return a null object. - * </remarks> - * <param name="value">the array to create the new instance</param> - */ \ - inline m(array<mt>^ value, int32_t length) \ - : CacheableBuiltinArray(value, length) { } \ - inline m(apache::geode::client::Serializable* nativeptr) \ - : CacheableBuiltinArray(nativeptr) { } \ + * Static function to create a new instance copying + * from the given array. + * </summary> + * <remarks> + * Providing a null or zero size array will return a null object. + * </remarks> + * <param name="value">the array to create the new instance</param> + */ \ + inline static m^ Create(array<mt>^ value) \ + { \ + return (value != nullptr /*&& value->Length > 0*/ ? \ + gcnew m(value) : nullptr); \ + } \ + /** <summary> + * Static function to create a new instance copying + * from the given array. + * </summary> + * <remarks> + * Providing a null or zero size array will return a null object. + * </remarks> + * <param name="value">the array to create the new instance</param> + */ \ + inline static m^ Create(array<mt>^ value, int32_t length) \ + { \ + return (value != nullptr && value->Length > 0 ? \ + gcnew m(value, length) : nullptr); \ + } \ + /** <summary> + * Explicit conversion operator to contained array type. + * </summary> + */ \ + inline static explicit operator array<mt> ^ (m^ value) \ + { \ + return (value != nullptr ? value->Value : nullptr); \ + } \ + \ + /** <summary> + * Factory function to register this class. + * </summary> + */ \ + static IGFSerializable^ CreateDeserializable() \ + { \ + return gcnew m(); \ + } \ + \ + internal: \ + static IGFSerializable^ Create(apache::geode::client::Serializable* obj) \ + { \ + return (obj != nullptr ? gcnew m(obj) : nullptr); \ + } \ + \ + private: \ + /** <summary> + * Allocates a new instance + * </summary> + */ \ + inline m() \ + : CacheableBuiltinArray() { } \ + /** <summary> + * Allocates a new instance copying from the given array. + * </summary> + * <remarks> + * Providing a null or zero size array will return a null object. + * </remarks> + * <param name="value">the array to create the new instance</param> + */ \ + inline m(array<mt>^ value) \ + : CacheableBuiltinArray(value) { } \ + /** <summary> + * Allocates a new instance copying given length from the + * start of given array. + * </summary> + * <remarks> + * Providing a null or zero size array will return a null object. + * </remarks> + * <param name="value">the array to create the new instance</param> + */ \ + inline m(array<mt>^ value, int32_t length) \ + : CacheableBuiltinArray(value, length) { } \ + inline m(apache::geode::client::Serializable* nativeptr) \ + : CacheableBuiltinArray(nativeptr) { } \ }; @@ -472,56 +472,56 @@ namespace Apache /// as a distributable key object for caching. /// </summary> _GFCLI_CACHEABLE_KEY_DEF_NEW(apache::geode::client::CacheableBoolean, - CacheableBoolean, bool); + CacheableBoolean, bool); /// <summary> /// An immutable wrapper for bytes that can serve /// as a distributable key object for caching. /// </summary> _GFCLI_CACHEABLE_KEY_DEF_NEW(apache::geode::client::CacheableByte, - CacheableByte, Byte); + CacheableByte, Byte); /// <summary> /// An immutable wrapper for 16-bit characters that can serve /// as a distributable key object for caching. /// </summary> _GFCLI_CACHEABLE_KEY_DEF_NEW(apache::geode::client::CacheableWideChar, - CacheableCharacter, Char); + CacheableCharacter, Char); /// <summary> /// An immutable wrapper for doubles that can serve /// as a distributable key object for caching. /// </summary> _GFCLI_CACHEABLE_KEY_DEF_NEW(apache::geode::client::CacheableDouble, - CacheableDouble, Double); + CacheableDouble, Double); /// <summary> /// An immutable wrapper for floats that can serve /// as a distributable key object for caching. /// </summary> _GFCLI_CACHEABLE_KEY_DEF_NEW(apache::geode::client::CacheableFloat, - CacheableFloat, Single); + CacheableFloat, Single); /// <summary> /// An immutable wrapper for 16-bit integers that can serve /// as a distributable key object for caching. /// </summary> _GFCLI_CACHEABLE_KEY_DEF_NEW(apache::geode::client::CacheableInt16, - CacheableInt16, int16_t); + CacheableInt16, int16_t); /// <summary> /// An immutable wrapper for 32-bit integers that can serve /// as a distributable key object for caching. /// </summary> _GFCLI_CACHEABLE_KEY_DEF_NEW(apache::geode::client::CacheableInt32, - CacheableInt32, int32_t); + CacheableInt32, int32_t); /// <summary> /// An immutable wrapper for 64-bit integers that can serve /// as a distributable key object for caching. /// </summary> _GFCLI_CACHEABLE_KEY_DEF_NEW(apache::geode::client::CacheableInt64, - CacheableInt64, int64_t); + CacheableInt64, int64_t); // Built-in Cacheable array types http://git-wip-us.apache.org/repos/asf/geode-native/blob/fc9f1f6f/src/clicache/src/CacheableDate.cpp ---------------------------------------------------------------------- diff --git a/src/clicache/src/CacheableDate.cpp b/src/clicache/src/CacheableDate.cpp index 885598a..8e48ea0 100644 --- a/src/clicache/src/CacheableDate.cpp +++ b/src/clicache/src/CacheableDate.cpp @@ -23,7 +23,7 @@ #include "DataInput.hpp" #include "DataOutput.hpp" #include "Log.hpp" -#include "GemFireClassIds.hpp" +#include "GeodeClassIds.hpp" using namespace System; @@ -35,15 +35,15 @@ namespace Apache { CacheableDate::CacheableDate(DateTime dateTime) - : m_dateTime(dateTime),m_hashcode(0) + : m_dateTime(dateTime), m_hashcode(0) { // Round off dateTime to the nearest millisecond. int64_t ticksToAdd = m_dateTime.Ticks % TimeSpan::TicksPerMillisecond; ticksToAdd = (ticksToAdd >= (TimeSpan::TicksPerMillisecond / 2) ? - (TimeSpan::TicksPerMillisecond - ticksToAdd) : -ticksToAdd); + (TimeSpan::TicksPerMillisecond - ticksToAdd) : -ticksToAdd); m_dateTime = m_dateTime.AddTicks(ticksToAdd); - + } void CacheableDate::ToData(DataOutput^ output) @@ -69,13 +69,13 @@ namespace Apache } uint32_t CacheableDate::ObjectSize::get() - { - return (uint32_t)sizeof(DateTime); + { + return (uint32_t)sizeof(DateTime); } uint32_t CacheableDate::ClassId::get() { - return GemFireClassIds::CacheableDate; + return GeodeClassIds::CacheableDate; } String^ CacheableDate::ToString() @@ -90,7 +90,7 @@ namespace Apache TimeSpan epochSpan = m_dateTime - EpochTime; int64_t millitime = epochSpan.Ticks / TimeSpan::TicksPerMillisecond; - m_hashcode = (int) millitime ^ (int) ((int64)millitime >> 32); + m_hashcode = (int)millitime ^ (int)((int64)millitime >> 32); } return m_hashcode; } @@ -98,7 +98,7 @@ namespace Apache bool CacheableDate::Equals(ICacheableKey^ other) { if (other == nullptr || - other->ClassId != GemFireClassIds::CacheableDate) { + other->ClassId != GeodeClassIds::CacheableDate) { return false; } return m_dateTime.Equals(static_cast<CacheableDate^>( @@ -114,9 +114,9 @@ namespace Apache return (m_dateTime == otherDate->m_dateTime); } return false; - } // namespace Client - } // namespace Geode -} // namespace Apache + } // namespace Client + } // namespace Geode + } // namespace Apache - } //namespace +} //namespace http://git-wip-us.apache.org/repos/asf/geode-native/blob/fc9f1f6f/src/clicache/src/CacheableFileName.cpp ---------------------------------------------------------------------- diff --git a/src/clicache/src/CacheableFileName.cpp b/src/clicache/src/CacheableFileName.cpp index 451c327..f17ae53 100644 --- a/src/clicache/src/CacheableFileName.cpp +++ b/src/clicache/src/CacheableFileName.cpp @@ -22,7 +22,7 @@ #include "CacheableFileName.hpp" #include "DataOutput.hpp" #include "DataInput.hpp" -#include "GemFireClassIds.hpp" +#include "GeodeClassIds.hpp" using namespace System; namespace Apache @@ -58,7 +58,7 @@ namespace Apache uint32_t CacheableFileName::ClassId::get() { - return GemFireClassIds::CacheableFileName; + return GeodeClassIds::CacheableFileName; } uint32_t CacheableFileName::ObjectSize::get() @@ -72,14 +72,14 @@ namespace Apache return 0; } if (m_hashcode == 0) { - int localHashcode = 0; + int localHashcode = 0; uint32_t prime = 31; - pin_ptr<const wchar_t> pin_value = PtrToStringChars( m_str ); + pin_ptr<const wchar_t> pin_value = PtrToStringChars(m_str); for (int32_t i = 0; i < m_str->Length; i++) { localHashcode = prime*localHashcode + Char::ToLower(pin_value[i]); - } - m_hashcode = localHashcode ^ 1234321; + } + m_hashcode = localHashcode ^ 1234321; } return m_hashcode; } @@ -87,7 +87,7 @@ namespace Apache bool CacheableFileName::Equals(ICacheableKey^ other) { if (other == nullptr || - other->ClassId != GemFireClassIds::CacheableFileName) { + other->ClassId != GeodeClassIds::CacheableFileName) { return false; } return (m_str == static_cast<CacheableFileName^>(other)->m_str); @@ -102,9 +102,9 @@ namespace Apache return (m_str == otherFileName->m_str); } return false; - } // namespace Client - } // namespace Geode -} // namespace Apache + } // namespace Client + } // namespace Geode + } // namespace Apache - } //namespace +} //namespace http://git-wip-us.apache.org/repos/asf/geode-native/blob/fc9f1f6f/src/clicache/src/CacheableHashMap.hpp ---------------------------------------------------------------------- diff --git a/src/clicache/src/CacheableHashMap.hpp b/src/clicache/src/CacheableHashMap.hpp index cbf8183..d012a06 100644 --- a/src/clicache/src/CacheableHashMap.hpp +++ b/src/clicache/src/CacheableHashMap.hpp @@ -20,7 +20,7 @@ #include "gf_defs.hpp" #include "IGFSerializable.hpp" #include "ICacheableKey.hpp" -#include "GemFireClassIds.hpp" +#include "GeodeClassIds.hpp" using namespace System; using namespace System::Collections::Generic; @@ -48,7 +48,7 @@ namespace Apache /// <summary> /// Allocates a new empty instance. /// </summary> - inline CacheableHashMap() + inline CacheableHashMap() { } /// <summary> @@ -58,11 +58,11 @@ namespace Apache /// The dictionary whose elements are copied to this HashMap. /// </param> inline CacheableHashMap(Object^ dictionary) - { + { m_dictionary = dictionary; } - + /// <summary> /// Static function to create a new empty instance. /// </summary> @@ -80,7 +80,7 @@ namespace Apache return gcnew CacheableHashMap(dictionary); } - + // Region: IGFSerializable Members /// <summary> @@ -119,7 +119,7 @@ namespace Apache { inline virtual uint32_t get() { - return GemFireClassIds::CacheableHashMap; + return GeodeClassIds::CacheableHashMap; } }
