records.Macros

RecordMacros

Related Doc: package Macros

class RecordMacros[C <: Context] extends Common[C]

Linear Supertypes
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. RecordMacros
  2. Common
  3. Internal210
  4. AnyRef
  5. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Instance Constructors

  1. new RecordMacros(c: C)

Type Members

  1. implicit class RichContext extends AnyRef

    Definition Classes
    Internal210
  2. implicit class RichFlag extends AnyRef

    Definition Classes
    Internal210
  3. implicit class RichMethodSymbol extends AnyRef

    Definition Classes
    Internal210
  4. implicit class RichSymbol extends AnyRef

    Definition Classes
    Internal210
  5. implicit class RichUniverse extends AnyRef

    Definition Classes
    Internal210
  6. type Schema = Seq[(String, scala.reflect.macros.Universe.Type)]

    Definition Classes
    Common

Value Members

  1. final def !=(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Definition Classes
    AnyRef → Any
  3. object ->

    Extractor for the tree of a Tuple2 in the form x -> y

    Extractor for the tree of a Tuple2 in the form x -> y

    Definition Classes
    Common
  4. final def ==(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  5. object Tuple2

    Extractor for the tree of a Tuple2

    Extractor for the tree of a Tuple2

    Definition Classes
    Common
  6. def accessData(receiver: scala.reflect.macros.Universe.Tree, fieldName: String, tpe: scala.reflect.macros.Universe.Type): scala.reflect.macros.Universe.Tree

    Generate a specialized data access on a record

    Generate a specialized data access on a record

    Definition Classes
    Common
  7. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  8. val c: C

    Definition Classes
    RecordMacrosCommonInternal210
  9. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  10. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  11. def equals(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  12. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  13. def genDataAny(schema: Schema): scala.reflect.macros.Universe.Tree

    Generate _​_dataAny member

  14. def genDataExists(schema: Schema): scala.reflect.macros.Universe.Tree

    Generate _​_dataExists member

  15. def genEquals(schema: Schema): scala.reflect.macros.Universe.Tree

    Generate the equals method for Records.

    Generate the equals method for Records. Two records are equal iff:

    • They have the same number of fields
    • Their fields have the same names
    • Values of corresponding fields compare equal
  16. def genHashCode(schema: Schema): scala.reflect.macros.Universe.Tree

    Generate the hashCode method of a record.

    Generate the hashCode method of a record. The hasCode is an bitwise xor of the hashCodes of the field names (this one is calculated at compile time) and the hashCodes of the field values

  17. def genLookup(nameTree: scala.reflect.macros.Universe.Tree, data: Map[String, scala.reflect.macros.Universe.Tree], default: Option[scala.reflect.macros.Universe.Tree] = None, mayCache: Boolean = true): scala.reflect.macros.Universe.Tree

    Generate a lookup amongst the keys in data and map to the tree values.

    Generate a lookup amongst the keys in data and map to the tree values. This is like an exhaustive pattern match on the strings, but may be implemented more efficiently. If default is None, it is assumed that nameTree evaluates to one of the keys of data. Otherwise the default tree is used if a key doesn't exist. If mayCache is true, the implementation might decide to store the evaluated trees somewhere (at runtime). Otherwise, the trees will be evaluated each time the resulting tree is evaluated.

  18. def genRecord(schema: Schema, ancestors: Seq[scala.reflect.macros.Universe.Ident], impl: Seq[scala.reflect.macros.Universe.Tree]): scala.reflect.macros.Universe.Tree

    Generalized record.

    Generalized record. Implementation is totally left to the caller.

    schema

    List of (field name, field type) tuples

    ancestors

    Traits that are mixed into the resulting Rec (e.g. Serializable). Make sure the idents are fully qualified.

    impl

    However you want to implement the _​_data interface.

  19. def genToString(schema: Schema): scala.reflect.macros.Universe.Tree

    Generate the toString method of a record.

    Generate the toString method of a record. The resulting toString method will generate strings of the form:

    Rec { fieldName1 = fieldValue1, fieldName2 = fieldValue2, ... }
  20. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  21. def hashCode(): Int

    Definition Classes
    AnyRef → Any
  22. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  23. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  24. final def notify(): Unit

    Definition Classes
    AnyRef
  25. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  26. val rImplMods: scala.reflect.macros.Universe.Modifiers

    Attributes
    protected
  27. def record(schema: Schema)(ancestors: scala.reflect.macros.Universe.Ident*)(fields: scala.reflect.macros.Universe.Tree*)(dataImpl: scala.reflect.macros.Universe.Tree): scala.reflect.macros.Universe.Tree

    Create a Record

    Create a Record

    This creates a simple record that implements _​_data. As a consequence it needs to box when used with primitive types.

    schema

    List of (field name, field type) tuples

    ancestors

    Traits that are mixed into the resulting Rec (e.g. Serializable). Make sure the idents are fully qualified.

    fields

    Additional members/fields of the resulting Rec (recommended for private data fields)

    dataImpl

    Implementation of the _​_data method. Should use the parameter fieldName of type String and the type parameter T and return a value of type T return a value of a corresponding type.

  28. def recordApply(v: Seq[C.Expr[(String, Any)]]): C.Expr[Rec[Any]]

    Macro that implements Rec.applyDynamic and Rec.applyDynamicNamed.

    Macro that implements Rec.applyDynamic and Rec.applyDynamicNamed. You probably won't need this.

  29. def recordFields(recType: scala.reflect.macros.Universe.Type): Schema

    Determine the fields of a record

    Determine the fields of a record

    Definition Classes
    Common
  30. def specializedRecord(schema: Schema)(ancestors: scala.reflect.macros.Universe.Ident*)(fields: scala.reflect.macros.Universe.Tree*)(objectDataImpl: scala.reflect.macros.Universe.Tree)(dataImpl: PartialFunction[scala.reflect.macros.Universe.Type, scala.reflect.macros.Universe.Tree]): scala.reflect.macros.Universe.Tree

    Create a specialized record

    Create a specialized record

    By providing implementations for all or some primitive types, boxing can be avoided.

    schema

    List of (field name, field type) tuples

    ancestors

    Traits that are mixed into the resulting Rec (e.g. Serializable). Make sure the idents are fully qualified.

    fields

    Additional members/fields of the resulting Rec (recommended for private data fields)

    objectDataImpl

    Implementation of the _​_dataObj method. Should use the parameter fieldName of type String and the type parameter T and return a value of type T

    dataImpl

    Partial function giving the implementations of the _​_data* methods. If it is not defined for some of the _​_data* methods, ??? will be used instead. Should use the parameter fieldName of type String and return a value of a corresponding type. The partial function will be called exactly once with each value in specializedTypes.

  31. val specializedTypes: Set[scala.reflect.macros.Universe.Type]

    Set of types for which the _​_data* members are specialized

  32. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  33. val synthMod: scala.reflect.macros.Universe.Modifiers

    Attributes
    protected
  34. def toString(): String

    Definition Classes
    AnyRef → Any
  35. final def wait(): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  36. final def wait(arg0: Long, arg1: Int): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  37. final def wait(arg0: Long): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from Common[C]

Inherited from Internal210

Inherited from AnyRef

Inherited from Any

Ungrouped