Working on Output

This commit is contained in:
Alexander Nozik 2018-12-20 10:40:32 +03:00
parent 81d7fbcffa
commit 83a56fa0cd
4 changed files with 30 additions and 4 deletions

View File

@ -14,7 +14,7 @@ import kotlin.reflect.KClass
*/ */
interface Data<out T : Any> : MetaRepr { interface Data<out T : Any> : MetaRepr {
/** /**
* Type marker for the data. The type is known before the calculation takes place so it could be cheched. * Type marker for the data. The type is known before the calculation takes place so it could be checked.
*/ */
val type: KClass<out T> val type: KClass<out T>
/** /**

View File

@ -1,5 +1,5 @@
plugins { plugins {
id "org.jetbrains.kotlin.multiplatform" id("org.jetbrains.kotlin.multiplatform")
} }
repositories { repositories {
@ -9,7 +9,7 @@ repositories {
kotlin { kotlin {
targets { targets {
fromPreset(presets.jvm, 'jvm') fromPreset(presets.jvm, 'jvm')
//fromPreset(presets.js, 'js') fromPreset(presets.js, 'js')
// For ARM, preset should be changed to presets.iosArm32 or presets.iosArm64 // For ARM, preset should be changed to presets.iosArm32 or presets.iosArm64
// For Linux, preset should be changed to e.g. presets.linuxX64 // For Linux, preset should be changed to e.g. presets.linuxX64
// For MacOS, preset should be changed to e.g. presets.macosX64 // For MacOS, preset should be changed to e.g. presets.macosX64
@ -19,6 +19,19 @@ kotlin {
commonMain { commonMain {
dependencies { dependencies {
api project(":dataforge-context") api project(":dataforge-context")
api project(":dataforge-meta-io")
}
}
jvmMain {
dependencies {
}
}
jsMain {
dependencies {
} }
} }
} }

View File

@ -0,0 +1,12 @@
package hep.dataforge.io
import hep.dataforge.context.ContextAware
import hep.dataforge.meta.EmptyMeta
import hep.dataforge.meta.Meta
/**
* A generic way to render any object in the output.
*/
interface Output<in T: Any> : ContextAware {
fun render(obj: T, meta: Meta = EmptyMeta)
}

View File

@ -12,5 +12,6 @@ include(
":dataforge-meta", ":dataforge-meta",
":dataforge-meta-io", ":dataforge-meta-io",
":dataforge-context", ":dataforge-context",
":dataforge-data" ":dataforge-data",
":dataforge-io"
) )