예제 #1
0
        /// <summary>
        ///     Initializes a new instance of the <see cref="DistributedSet{T}" /> class.
        /// </summary>
        /// <param name="name">
        ///     The name of the collection.
        /// </param>
        internal DistributedSet(string name)
        {
            Should.NotBeNull(name, nameof(name));
            Should.BeSerializable(typeof(T), "T");

            this.Name  = name;
            this.items = new HashSet <T>();
        }
예제 #2
0
        /// <summary>
        ///     Initializes a new instance of the <see cref="DistributedDictionary{TKey, TValue}" /> class.
        /// </summary>
        /// <param name="name">
        ///     The name of the collection.
        /// </param>
        internal DistributedDictionary(string name)
        {
            Should.NotBeNull(name, nameof(name));
            Should.BeSerializable(typeof(TKey), "TKey");
            Should.BeSerializable(typeof(TValue), "TKey");

            this.Name       = name;
            this.dictionary = new ConcurrentDictionary <TKey, TValue>();
        }
예제 #3
0
        /// <summary>
        ///     Initializes a new instance of the <see cref="DistributedQueue{T}" /> class.
        /// </summary>
        /// <param name="name">
        ///     The name of the collection.
        /// </param>
        /// <param name="parentNode">
        ///     The parent node of the collection.
        /// </param>
        internal DistributedQueue(string name, INode parentNode)
        {
            Should.NotBeNull(name, nameof(name));
            Should.NotBeNull(parentNode, nameof(parentNode));
            Should.BeSerializable(typeof(T), "T");

            this.Name       = name;
            this.ParentNode = parentNode;
            this.queue      = new Queue <T>();
        }
예제 #4
0
        /// <summary>
        ///     Initializes a new instance of the <see cref="DistributedSet{T}" /> class.
        /// </summary>
        /// <param name="name">
        ///     The name of the collection.
        /// </param>
        /// <param name="parentNode">
        ///     The parent node of the collection.
        /// </param>
        internal DistributedSet(string name, INode parentNode)
        {
            Should.NotBeNull(name, nameof(name));
            Should.NotBeNull(parentNode, nameof(parentNode));
            Should.BeSerializable(typeof(T), "T");

            this.Name       = name;
            this.ParentNode = parentNode;
            this.set        = new HashSet <T>();
        }
예제 #5
0
        /// <summary>
        ///     Initializes a new instance of the <see cref="DistributedDictionary{TKey, TValue}" /> class.
        /// </summary>
        /// <param name="name">
        ///     The name of the collection.
        /// </param>
        /// <param name="parentNode">
        ///     The parent node of the collection.
        /// </param>
        public DistributedDictionary(string name, INode parentNode)
        {
            Should.NotBeNull(name, nameof(name));
            Should.NotBeNull(parentNode, nameof(parentNode));
            Should.BeSerializable(typeof(TKey), "TKey");
            Should.BeSerializable(typeof(TValue), "TKey");

            this.Name       = name;
            this.ParentNode = parentNode;
            this.dictionary = new ConcurrentDictionary <TKey, TValue>();
        }