Beispiel #1
0
 /// <summary>
 ///		Creates a read-only wrapper for a
 ///     <c>MarketLogVector</c> instance.
 /// </summary>
 /// <returns>
 ///     An <c>MarketLogVector</c> wrapper that is read-only.
 /// </returns>
 public static MarketLogVector ReadOnly(MarketLogVector list)
 {
     if (list == null)
     {
         throw new ArgumentNullException("list");
     }
     return(new ReadOnlyMarketLogVector(list));
 }
Beispiel #2
0
 /// <summary>
 ///		Creates a synchronized (thread-safe) wrapper for a
 ///     <c>MarketLogVector</c> instance.
 /// </summary>
 /// <returns>
 ///     An <c>MarketLogVector</c> wrapper that is synchronized (thread-safe).
 /// </returns>
 public static MarketLogVector Synchronized(MarketLogVector list)
 {
     if (list == null)
     {
         throw new ArgumentNullException("list");
     }
     return(new SyncMarketLogVector(list));
 }
Beispiel #3
0
        /// <summary>
        ///		Creates a shallow copy of the <see cref="MarketLogVector"/>.
        /// </summary>
        public virtual object Clone()
        {
            MarketLogVector newColl = new MarketLogVector(m_count);

            Array.Copy(m_array, 0, newColl.m_array, 0, m_count);
            newColl.m_count   = m_count;
            newColl.m_version = m_version;

            return(newColl);
        }
Beispiel #4
0
        /// <summary>
        ///		Adds the elements of another <c>MarketLogVector</c> to the current <c>MarketLogVector</c>.
        /// </summary>
        /// <param name="x">The <c>MarketLogVector</c> whose elements should be added to the end of the current <c>MarketLogVector</c>.</param>
        /// <returns>The new <see cref="MarketLogVector.Count"/> of the <c>MarketLogVector</c>.</returns>
        public virtual int AddRange(MarketLogVector x)
        {
            if (m_count + x.Count >= m_array.Length)
            {
                EnsureCapacity(m_count + x.Count);
            }

            Array.Copy(x.m_array, 0, m_array, m_count, x.Count);
            m_count += x.Count;
            m_version++;

            return(m_count);
        }
Beispiel #5
0
            public override int AddRange(MarketLogVector x)
            {
                int result = 0;

                rwLock.AcquireWriterLock(timeout);

                try
                {
                    result = collection.AddRange(x);
                }
                finally
                {
                    rwLock.ReleaseWriterLock();
                }

                return(result);
            }
Beispiel #6
0
 /// <summary>
 ///		Initializes a new instance of the <c>Enumerator</c> class.
 /// </summary>
 /// <param name="tc"></param>
 internal Enumerator(MarketLogVector tc)
 {
     m_collection = tc;
     m_index      = -1;
     m_version    = tc.m_version;
 }
Beispiel #7
0
 /// <summary>
 ///		Initializes a new instance of the <c>MarketLogVector</c> class
 ///		that contains elements copied from the specified <c>MarketLogVector</c>.
 /// </summary>
 /// <param name="c">The <c>MarketLogVector</c> whose elements are copied to the new collection.</param>
 public MarketLogVector(MarketLogVector c)
 {
     m_array = new MarketLog[c.Count];
     AddRange(c);
 }
Beispiel #8
0
 public override int AddRange(MarketLogVector x)
 {
     throw new NotSupportedException("This is a Read Only Collection and can not be modified");
 }
 /// <summary>
 ///		Creates a synchronized (thread-safe) wrapper for a 
 ///     <c>MarketLogVector</c> instance.
 /// </summary>
 /// <returns>
 ///     An <c>MarketLogVector</c> wrapper that is synchronized (thread-safe).
 /// </returns>
 public static MarketLogVector Synchronized( MarketLogVector list )
 {
     if ( list == null )
         throw new ArgumentNullException( "list" );
     return new SyncMarketLogVector( list );
 }
 internal SyncMarketLogVector( MarketLogVector list )
     : base(Tag.Default)
 {
     rwLock = new System.Threading.ReaderWriterLock();
     collection = list;
 }
 public override int AddRange( MarketLogVector x )
 {
     throw new NotSupportedException( "This is a Read Only Collection and can not be modified" );
 }
 internal ReadOnlyMarketLogVector( MarketLogVector list )
     : base(Tag.Default)
 {
     m_collection = list;
 }
 /// <summary>
 ///		Initializes a new instance of the <c>Enumerator</c> class.
 /// </summary>
 /// <param name="tc"></param>
 internal Enumerator( MarketLogVector tc )
 {
     m_collection = tc;
     m_index = -1;
     m_version = tc.m_version;
 }
 /// <summary>
 ///		Initializes a new instance of the <c>MarketLogVector</c> class
 ///		that contains elements copied from the specified <c>MarketLogVector</c>.
 /// </summary>
 /// <param name="c">The <c>MarketLogVector</c> whose elements are copied to the new collection.</param>
 public MarketLogVector( MarketLogVector c )
 {
     m_array = new MarketLog[c.Count];
     AddRange( c );
 }
        /// <summary>
        ///		Creates a shallow copy of the <see cref="MarketLogVector"/>.
        /// </summary>
        public virtual object Clone()
        {
            MarketLogVector newColl = new MarketLogVector( m_count );
            Array.Copy( m_array, 0, newColl.m_array, 0, m_count );
            newColl.m_count = m_count;
            newColl.m_version = m_version;

            return newColl;
        }
        /// <summary>
        ///		Adds the elements of another <c>MarketLogVector</c> to the current <c>MarketLogVector</c>.
        /// </summary>
        /// <param name="x">The <c>MarketLogVector</c> whose elements should be added to the end of the current <c>MarketLogVector</c>.</param>
        /// <returns>The new <see cref="MarketLogVector.Count"/> of the <c>MarketLogVector</c>.</returns>
        public virtual int AddRange( MarketLogVector x )
        {
            if ( m_count + x.Count >= m_array.Length )
                EnsureCapacity( m_count + x.Count );

            Array.Copy( x.m_array, 0, m_array, m_count, x.Count );
            m_count += x.Count;
            m_version++;

            return m_count;
        }
Beispiel #17
0
 internal SyncMarketLogVector(MarketLogVector list)
     : base(Tag.Default)
 {
     rwLock     = new System.Threading.ReaderWriterLock();
     collection = list;
 }
            public override int AddRange( MarketLogVector x )
            {
                int result = 0;
                rwLock.AcquireWriterLock( timeout );

                try
                {
                    result = collection.AddRange( x );
                }
                finally
                {
                    rwLock.ReleaseWriterLock();
                }

                return result;
            }
Beispiel #19
0
 internal ReadOnlyMarketLogVector(MarketLogVector list)
     : base(Tag.Default)
 {
     m_collection = list;
 }
 /// <summary>
 ///		Creates a read-only wrapper for a 
 ///     <c>MarketLogVector</c> instance.
 /// </summary>
 /// <returns>
 ///     An <c>MarketLogVector</c> wrapper that is read-only.
 /// </returns>
 public static MarketLogVector ReadOnly( MarketLogVector list )
 {
     if ( list == null )
         throw new ArgumentNullException( "list" );
     return new ReadOnlyMarketLogVector( list );
 }