Packages

sealed class DataView[T, V <: Data] extends AnyRef

Mapping between a target type T and a view type V

Enables calling .viewAs[T] on instances of the target type.

Detailed documentation

T

Target type (must have an implementation of DataProduct)

V

View type

Annotations
@implicitNotFound( ... )
Example:
  1. class Foo(val w: Int) extends Bundle {
      val a = UInt(w.W)
    }
    class Bar(val w: Int) extends Bundle {
      val b = UInt(w.W)
    }
    // DataViews are created using factory methods in the companion object
    implicit val view = DataView[Foo, Bar](
      // The first argument is a function constructing a Foo from a Bar
      foo => new Bar(foo.w)
      // The remaining arguments are a variable number of field pairings
      _.a -> _.b
    )
See also

object DataView for factory methods

object PartialDataView for defining non-total DataViews

Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. DataView
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. def andThen[V2 <: Data](g: DataView[V, V2])(implicit sourceInfo: SourceInfo): DataView[T, V2]

    Compose two DataViews together to construct a view from the target of this DataView to the view type of the second DataView

    Compose two DataViews together to construct a view from the target of this DataView to the view type of the second DataView

    V2

    View type of DataView g

    g

    a DataView from V to new view-type V2

    returns

    a new DataView from the original T to new view-type V2

  5. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  6. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native() @HotSpotIntrinsicCandidate()
  7. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  8. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  9. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  10. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  11. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  12. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  13. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  14. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  15. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  16. def toString(): String
    Definition Classes
    DataView → AnyRef → Any
  17. def total: Boolean

    Indicates if the mapping contains every field of the target

  18. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  19. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()
  20. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Deprecated Value Members

  1. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] ) @Deprecated
    Deprecated

Inherited from AnyRef

Inherited from Any

Ungrouped