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; }
/// <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); } } }
/// <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()); }
internal RrdInt(IRrdUpdater updater) : this(updater, false) { }
internal RrdInt(IRrdUpdater updater, bool isConstant) : base(updater, RRD_INT, isConstant) { }
internal RrdString(IRrdUpdater updater) : this(updater, false) { }
internal RrdString(IRrdUpdater updater, bool isConstant) : base(updater, RRD_STRING, isConstant) { }
protected RrdPrimitive(IRrdUpdater updater, int type, bool isConstant) : this(updater, type, 1, isConstant) { }
internal RrdDouble(IRrdUpdater updater) : base(updater, RRD_DOUBLE, false) { }
internal RrdDouble(IRrdUpdater updater, bool isConstant) : base(updater, RRD_DOUBLE, isConstant) { }
/// <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()); }
/// <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()); }
internal RrdDoubleArray(IRrdUpdater updater, int length) : base(updater, RRD_DOUBLE, length, false) { this.length = length; }