records.Macros

RecordMacros

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: AnyRef): Boolean

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

    Definition Classes
    AnyRef → Any
  4. object ->

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

  5. final def ==(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  6. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  7. object Tuple2

    Extractor for the tree of a Tuple2

  8. def accessData(receiver: Tree, fieldName: String, tpe: scala.reflect.macros.Universe.Type): Tree

    Generate a specialized data access on a record

    Generate a specialized data access on a record

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

    Definition Classes
    Any
  10. val c: C

    Definition Classes
    RecordMacrosCommonInternal210
  11. def clone(): AnyRef

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

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

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

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  15. def genDataAny(schema: Schema): Tree

    Generate _​_dataAny member

  16. def genDataExists(schema: Schema): Tree

    Generate _​_dataExists member

  17. def genEquals(schema: Schema): 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
  18. def genHashCode(schema: Schema): 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

  19. def genLookup(nameTree: Tree, data: Map[String, Tree], default: Option[Tree] = None, mayCache: Boolean = true): 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.

  20. def genRecord(schema: Schema, ancestors: Seq[Ident], impl: Seq[Tree]): 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.

  21. def genToString(schema: Schema): 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, ... }
  22. final def getClass(): Class[_]

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

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

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

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

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

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

    Attributes
    protected
  29. def record(schema: Schema)(ancestors: Ident*)(fields: Tree*)(dataImpl: Tree): 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.

  30. 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.

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

    Determine the fields of a record

    Determine the fields of a record

    Definition Classes
    Common
  32. def specializedRecord(schema: Schema)(ancestors: Ident*)(fields: Tree*)(objectDataImpl: Tree)(dataImpl: PartialFunction[scala.reflect.macros.Universe.Type, Tree]): 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.

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

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

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

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

    Attributes
    protected
  36. def toString(): String

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

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

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  39. 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