Example #1
0
		internal RrdPrimitive(IRrdUpdater updater, int type, int count, bool isConstant)
		{
			backend = updater.GetRrdBackend();
			byteCount = RRD_PRIM_SIZES[type]*count;
			pointer = updater.GetRrdAllocator().Allocate(byteCount);
			cachingAllowed = isConstant || backend.CachingAllowed;
		}
Example #2
0
		/// <summary>
		/// Copies object's internal state to another ArcState object.
		/// </summary>
		/// <param name="other"> New ArcState object to copy state to</param>
		public void CopyStateTo(IRrdUpdater other)
		{
			if (!(other is Robin))
			{
				throw new RrdException(
					"Cannot copy Robin object to " + other.GetType().Name);
			}
			var robin = (Robin) other;
			int rowsDiff = rows - robin.rows;
			if (rowsDiff == 0)
			{
				// Identical dimensions. Do copy in BULK to speed things up
				robin.pointer.Set(pointer.Get());
				robin.values.WriteBytes(values.ReadBytes());
			}
			else
			{
				// different sizes
				for (int i = 0; i < robin.rows; i++)
				{
					int j = i + rowsDiff;
					robin.Store(j >= 0 ? GetValue(j) : Double.NaN);
				}
			}
		}
Example #3
0
		/// <summary>
		/// Copies object's internal state to another ArcState object.
		/// </summary>
		/// <param name="other"> New ArcState object to copy state to</param>
		public void CopyStateTo(IRrdUpdater other)
		{
			if (!(other is ArcState))
			{
				throw new RrdException(
					"Cannot copy ArcState object to " + other.GetType().Name);
			}
			var arcState = (ArcState) other;
			arcState.accumumatedValue.Set(accumumatedValue.Get());
			arcState.nanSteps.Set(nanSteps.Get());
		}
Example #4
0
		internal RrdInt(IRrdUpdater updater)
			: this(updater, false)
		{
		}
Example #5
0
		internal RrdInt(IRrdUpdater updater, bool isConstant)
			: base(updater, RRD_INT, isConstant)
		{
		}
Example #6
0
		internal RrdString(IRrdUpdater updater) :
			this(updater, false)
		{
		}
Example #7
0
		internal RrdString(IRrdUpdater updater, bool isConstant)
			: base(updater, RRD_STRING, isConstant)
		{
		}
Example #8
0
		protected RrdPrimitive(IRrdUpdater updater, int type, bool isConstant)
			: this(updater, type, 1, isConstant)
		{
		}
Example #9
0
		internal RrdDouble(IRrdUpdater updater) : base(updater, RRD_DOUBLE, false)
		{
		}
Example #10
0
		internal RrdDouble(IRrdUpdater updater, bool isConstant) : base(updater, RRD_DOUBLE, isConstant)
		{
		}
Example #11
0
		/// <summary>
		/// Copies object's internal state to another ArcState object.
		/// </summary>
		/// <param name="updater"> New ArcState object to copy state to</param>
		public void CopyStateTo(IRrdUpdater other)
		{
			if (!(other is Header))
			{
				throw new RrdException("Cannot copy Header object to " + other.GetType().Name);
			}
			var header = (Header) other;
			header.signature.Set(signature.Get());
			header.lastUpdateTime.Set(lastUpdateTime.Get());
		}
Example #12
0
		/// <summary>
		/// Copies object's internal state to another ArcState object.
		/// </summary>
		/// <param name="other"> New ArcState object to copy state to</param>
		public void CopyStateTo(IRrdUpdater other)
		{
			if (!(other is DataSource))
			{
				throw new RrdException("Cannot copy Datasource object to " + other.GetType().Name);
			}
			var datasource = (DataSource) other;
			if (!datasource.dsName.Get().Equals(dsName.Get()))
			{
				throw new RrdException("Incomaptible datasource names");
			}
			if (!datasource.dsType.Get().Equals(dsType.Get()))
			{
				throw new RrdException("Incomaptible datasource types");
			}
			datasource.lastValue.Set(lastValue.Get());
			datasource.nanSeconds.Set(nanSeconds.Get());
			datasource.accumValue.Set(accumValue.Get());
		}
Example #13
0
		internal RrdDoubleArray(IRrdUpdater updater, int length) : base(updater, RRD_DOUBLE, length, false)
		{
			this.length = length;
		}