// Value is the current value of this decaying error value - the time since it was
// created is stored for adjustment.
976458
func (decaying *Decaying) Value() float64 {
	decaying.Lock()
	now := time.Now()
	dt := now.Sub(decaying.t0).Seconds()
	decaying.t0 = now
	curValP := decaying.p
	decaying.p = curValP * math.Pow(decaying.e, (decaying.r*dt))
	pOut := decaying.p
	decaying.Unlock()
	return pOut
}
165318
func (w *OrderedValue) Value() interface{} {
	w.lock.Lock()

	// If we have a pending value already, use it
	if w.values != nil && w.values.Len() > 0 {
		front := w.values.Front()
		w.values.Remove(front)
		w.lock.Unlock()
		return front.Value
	}

	// No pending value, create a waiter
	if w.waiters == nil {
		w.waiters = list.New()
	}

	var val Value
	w.waiters.PushBack(&val)
	w.lock.Unlock()

	// Return the value once we have it
	return val.Value()
}
112537
func (finfo *fieldInfo) value(v reflect.Value) reflect.Value {
	for i, x := range finfo.idx {
		if i > 0 {
			t := v.Type()
			if t.Kind() == reflect.Ptr && t.Elem().Kind() == reflect.Struct {
				if v.IsNil() {
					v.Set(reflect.New(v.Type().Elem()))
				}
				v = v.Elem()
			}
		}
		v = v.Field(x)
	}
	return v
}
1047893
func (n NullInt64) Value() (driver.Value, error) {
	if !n.Valid {
		return nil, nil
	}
	return n.Int64, nil
}
1002047
func (itr *memDBIterator) Value() []byte {
	itr.assertIsValid()
	key := []byte(itr.keys[itr.cur])
	return itr.db.Get(key)
}
917257
func (ae *atomicError) Value() error {
	if v := ae.value.Load(); v != nil {
		// this will panic if the value doesn't implement the error interface
		return v.(error)
	}
	return nil
}
470034
func (iter *Iterator) Value() []byte {
	if iter.node == nil {
		return nil
	}
	return iter.node.value
}
662721
func (src *TimestampArray) Value() (driver.Value, error) {
	buf, err := src.EncodeText(nil, nil)
	if err != nil {
		return nil, err
	}
	if buf == nil {
		return nil, nil
	}

	return string(buf), nil
}
486182
func (d *decodeState) value(v reflect.Value) {
	if !v.IsValid() {
		_, rest, err := NextValue(d.data[d.off:], &d.nextscan)
		if err != nil {
			d.error(err)
		}
		d.off = len(d.data) - len(rest)

		// d.scan thinks we're still at the beginning of the item.
		// Feed in an empty string - the shortest, simplest value -
		// so that it knows we got to the end of the value.
		if d.scan.redo {
			// rewind.
			d.scan.redo = false
			d.scan.Step = stateBeginValue
		}
		d.scan.Step(&d.scan, '"')
		d.scan.Step(&d.scan, '"')

		n := len(d.scan.parseState)
		if n > 0 && d.scan.parseState[n-1] == parseObjectKey {
			// d.scan thinks we just read an object key; finish the object
			d.scan.Step(&d.scan, ':')
			d.scan.Step(&d.scan, '"')
			d.scan.Step(&d.scan, '"')
			d.scan.Step(&d.scan, '}')
		}

		return
	}

	switch op := d.scanWhile(ScanSkipSpace); op {
	default:
		d.error(errPhase)

	case ScanBeginArray:
		d.array(v)

	case ScanBeginObject:
		d.object(v)

	case ScanBeginLiteral:
		d.literal(v)
	}
}
1372574
func (src *Numeric) Value() (driver.Value, error) {
	switch src.Status {
	case Present:
		buf, err := src.EncodeText(nil, nil)
		if err != nil {
			return nil, err
		}

		return string(buf), nil
	case Null:
		return nil, nil
	default:
		return nil, errUndefined
	}
}
665301
func (c *changer) Value() (interface{}, error) {
	if c.err != nil {
		return nil, c.err
	}
	return c.node.content.value(), nil
}
297853
func (v *NowValuer) Value(key string) (interface{}, bool) {
	if !v.Now.IsZero() && key == "now()" {
		return v.Now, true
	}
	return nil, false
}
927034
func (w *Value) Value() interface{} {
	w.lock.Lock()
	defer w.lock.Unlock()

	// If we already have a value just return
	for !w.valueSet {
		// No value, setup the condition variable if we have to
		if w.cond == nil {
			w.cond = sync.NewCond(&w.lock)
		}

		// Wait on it
		w.cond.Wait()
	}

	// Return the value
	return w.value
}
924874
func (src *Date) Value() (driver.Value, error) {
	switch src.Status {
	case Present:
		if src.InfinityModifier != None {
			return src.InfinityModifier.String(), nil
		}
		return src.Time, nil
	case Null:
		return nil, nil
	default:
		return nil, errUndefined
	}
}
975996
func (it *iterator) Value() []byte {
	if len(it.values) > 0 {
		return it.values[0]
	}
	return nil
}
1302850
func (c *Counter) Value() float64 {
	return math.Float64frombits(atomic.LoadUint64(&c.bits))
}
398088
func (pi *PromisedID) Value() (int, error) {
	if *pi == -1 {
		return -1, errors.New("value has not been computed yet")
	}
	return (int)(*pi), nil
}