
com.avsystem.commons.macros.serialization.BsonRefMacros.scala Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of commons-macros_2.12 Show documentation
Show all versions of commons-macros_2.12 Show documentation
AVSystem commons library for Scala
The newest version!
package com.avsystem.commons
package macros.serialization
import scala.reflect.macros.blackbox
class BsonRefMacros(ctx: blackbox.Context) extends CodecMacroCommons(ctx) {
import c.universe._
final def MongoPkg: Tree = q"$CommonsPkg.mongo"
def bsonRef[S: WeakTypeTag, T: WeakTypeTag](fun: Tree): Tree = {
val sType = weakTypeOf[S]
val tType = weakTypeOf[T]
q"$MongoPkg.BsonRef($SerializationPkg.GenRef.create[$sType].ref[$tType]($fun))"
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy