records.Macros

RecordMacros

class RecordMacros[C <: Context] extends Internal210

Linear Supertypes
Known Subclasses
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. RecordMacros
  2. Internal210
  3. AnyRef
  4. 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. type Schema = Seq[(String, scala.reflect.macros.Universe.Type)]

Value Members

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

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

    Definition Classes
    AnyRef → Any
  3. object ->

  4. final def ==(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  5. 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

  6. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  7. val c: C

    Definition Classes
    RecordMacrosInternal210
  8. def clone(): AnyRef

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

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

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

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

    Generate _​_dataAny member

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

    Generate _​_dataExists member

  14. 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
  15. 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

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

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

  18. def genRecordField(name: String, tpe: scala.reflect.macros.Universe.Type): scala.reflect.macros.Universe.Tree

    Create a tree for a 'def' of a record field.

    Create a tree for a 'def' of a record field. If a type of the field is yet another record, it will be a class type of the $​anon class (created as part of genRecord), rather than a pure RefinedType. Therefore we have to recreate it and provide an appropriate type to the macro call.

  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]

    Macro that implements Rec.apply.

    Macro that implements Rec.apply. You probably won't need this.

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

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

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

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

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

    Attributes
    protected
  33. def toString(): String

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

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

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

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from Internal210

Inherited from AnyRef

Inherited from Any

Ungrouped