mirror of https://github.com/KLayout/klayout.git
commit
5aca54257d
|
|
@ -74,3 +74,7 @@ py.typed
|
|||
*.dmg.md5
|
||||
.DS_Store
|
||||
|
||||
# temp files
|
||||
.tmp*
|
||||
.venv
|
||||
|
||||
|
|
|
|||
|
|
@ -93,7 +93,7 @@ jobs:
|
|||
|
||||
- script: |
|
||||
# setuptools 67.0.0 is not working as of now (pypa/setuptools#4885)
|
||||
python -m pip install --upgrade pip "setuptools<76.0.0" wheel
|
||||
python -m pip install --upgrade pip "setuptools<76.0.0" wheel tomli
|
||||
displayName: 'Update pip, setuptools and wheel'
|
||||
|
||||
- script: |
|
||||
|
|
|
|||
10
build.sh
10
build.sh
|
|
@ -40,6 +40,7 @@ HAVE_PNG=0
|
|||
HAVE_CURL=0
|
||||
HAVE_EXPAT=0
|
||||
HAVE_GIT2=1
|
||||
HAVE_LSTREAM=1
|
||||
|
||||
RUBYINCLUDE=""
|
||||
RUBYINCLUDE2=""
|
||||
|
|
@ -213,6 +214,9 @@ while [ "$*" != "" ]; do
|
|||
-nolibgit2)
|
||||
HAVE_GIT2=0
|
||||
;;
|
||||
-nolstream)
|
||||
HAVE_LSTREAM=0
|
||||
;;
|
||||
-qt5)
|
||||
echo "*** WARNING: -qt5 option is ignored - Qt version is auto-detected now."
|
||||
;;
|
||||
|
|
@ -270,6 +274,7 @@ while [ "$*" != "" ]; do
|
|||
echo " -libexpat Use libexpat instead of QtXml"
|
||||
echo " -libpng Use libpng instead of Qt for PNG generation"
|
||||
echo " -nolibgit2 Do not include libgit2 for Git package support"
|
||||
echo " -nolstream Do not include the LStream plugin"
|
||||
echo ""
|
||||
echo "Environment Variables:"
|
||||
echo ""
|
||||
|
|
@ -503,6 +508,9 @@ fi
|
|||
if [ $HAVE_GIT2 != 0 ]; then
|
||||
echo " Uses libgit2 for Git access"
|
||||
fi
|
||||
if [ $HAVE_LSTREAM != 0 ]; then
|
||||
echo " Includes LStream plugin"
|
||||
fi
|
||||
if [ "$RPATH" = "" ]; then
|
||||
RPATH="$BIN"
|
||||
fi
|
||||
|
|
@ -587,6 +595,7 @@ echo " HAVE_CURL=$HAVE_CURL"
|
|||
echo " HAVE_PNG=$HAVE_PNG"
|
||||
echo " HAVE_EXPAT=$HAVE_EXPAT"
|
||||
echo " HAVE_GIT2=$HAVE_GIT2"
|
||||
echo " HAVE_LSTREAM=$HAVE_LSTREAM"
|
||||
echo " RPATH=$RPATH"
|
||||
|
||||
mkdir -p $BUILD
|
||||
|
|
@ -660,6 +669,7 @@ qmake_options=(
|
|||
HAVE_EXPAT="$HAVE_EXPAT"
|
||||
HAVE_PNG="$HAVE_PNG"
|
||||
HAVE_GIT2="$HAVE_GIT2"
|
||||
HAVE_LSTREAM="$HAVE_LSTREAM"
|
||||
PREFIX="$BIN"
|
||||
RPATH="$RPATH"
|
||||
KLAYOUT_VERSION="$KLAYOUT_VERSION"
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
[build-system]
|
||||
requires = ["setuptools"]
|
||||
requires = ["setuptools", "tomli"]
|
||||
build-backend = "setuptools.build_meta"
|
||||
|
||||
[tool.cibuildwheel]
|
||||
|
|
|
|||
780
setup.py
780
setup.py
|
|
@ -68,6 +68,7 @@ import distutils.command.build_ext
|
|||
import setuptools.command.build_ext
|
||||
from setuptools.command.build_ext import build_ext as _build_ext
|
||||
import multiprocessing
|
||||
import tomli
|
||||
|
||||
# for Jenkins we do not want to be greedy
|
||||
multicore = os.getenv("KLAYOUT_SETUP_MULTICORE")
|
||||
|
|
@ -253,6 +254,10 @@ setuptools.command.build_ext.link_shared_object = always_link_shared_object
|
|||
# ----------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
# TODO:
|
||||
# * Pull this from module-specific configuration files?
|
||||
# * Include dependencies: "extra_objects", "include_dirs"
|
||||
|
||||
class Config(object):
|
||||
|
||||
"""
|
||||
|
|
@ -282,6 +287,128 @@ class Config(object):
|
|||
|
||||
self.root = "klayout"
|
||||
|
||||
self.src_paths = { }
|
||||
self.modules = []
|
||||
|
||||
def module(self, name, src_path):
|
||||
"""
|
||||
Declares a module with the given name and source path
|
||||
|
||||
If a file called "pysetup.toml" is found in that
|
||||
path, it is read and a Library or Extension module
|
||||
is created.
|
||||
|
||||
Structure of TOML is:
|
||||
[library] or [extension]:
|
||||
name = "<module name>"
|
||||
depends = [ list of module names this extension depends on ]
|
||||
defines = [ list of [name, value] pairs of defines for this module ]
|
||||
submodules = [ additional parent modules: klayout.<submodules>.mod_name ]
|
||||
includes = [ additional include paths, "/a/b/..." is absolute in src, "a/b/..." is relative to module source ]
|
||||
sources = [ additional source paths, see 'includes', takes '*.cc' from there ]
|
||||
cxxflags = [ additional compiler options ]
|
||||
cxxflags-gcc = [ additional compiler options for gcc ]
|
||||
cxxflags-msvc = [ additional compiler options for msvc ]
|
||||
cxxflags-win32 = [ additional compiler options for Windows ]
|
||||
cxxflags-linux = [ additional compiler options for Linux ]
|
||||
cxxflags-darwin = [ additional compiler options for MacOS ]
|
||||
Compiler option "$libpng_cflags" is replaced by the libpng build flags
|
||||
ldflags* = [ additional linker options (*=same suffixes as cxxflags) ]
|
||||
Linker option "$libpng_ldflags" is replaced by the libpng linker flags
|
||||
libraries* = [ additional libraries (*=same suffixes as cxxflags) ]
|
||||
"""
|
||||
|
||||
pysetup_file = os.path.join(src_path, "pysetup.toml")
|
||||
if not os.path.isfile(pysetup_file):
|
||||
raise RuntimeError("Cannot find 'pysetup.toml' in " + src_path)
|
||||
|
||||
with open(pysetup_file, "rb") as f:
|
||||
pysetup = tomli.load(f)
|
||||
|
||||
header = {}
|
||||
is_library = None
|
||||
if "library" in pysetup:
|
||||
is_library = True
|
||||
header = pysetup["library"]
|
||||
elif "extension" in pysetup:
|
||||
is_library = False
|
||||
header = pysetup["extension"]
|
||||
else:
|
||||
raise RuntimeError("Invalid format - library or extension section expected in " + pysetup_file)
|
||||
|
||||
header_name = header.get("name", None)
|
||||
if name is not None and header_name is not None and name != header_name:
|
||||
raise RuntimeError("Module name and specified name in setup file do not match in " + pysetup_file + ": " + header_name + " vs. " + name)
|
||||
elif name is None:
|
||||
if header_name is None:
|
||||
raise RuntimeError("No module name specified in " + pysetup_file)
|
||||
name = header_name
|
||||
|
||||
depends = header.get("depends", [])
|
||||
for d in depends:
|
||||
# can't resolve now -> maybe later
|
||||
if d not in self.src_paths:
|
||||
return False
|
||||
|
||||
print("Adding module " + name + " from pysetup file " + pysetup_file + " ...")
|
||||
|
||||
self.src_paths[name] = src_path
|
||||
|
||||
defines = header.get("defines", [])
|
||||
submodules = header.get("submodules", [])
|
||||
includes = header.get("includes", [])
|
||||
source_paths = header.get("sources", [])
|
||||
|
||||
mod_path = ".".join([ self.root ] + submodules + [ name ])
|
||||
include_dirs = [ self.src_path(m) for m in depends ] + [ src_path ]
|
||||
extra_objects = [ self.path_of(m) for m in depends ]
|
||||
define_macros = self.macros() + [ tuple(d) for d in defines ]
|
||||
|
||||
sources = self.sources(name)
|
||||
for i in source_paths:
|
||||
p = i.split("/")
|
||||
if len(p) > 0 and p[0] == "":
|
||||
del p[0]
|
||||
else:
|
||||
p = [ src_path ] + p
|
||||
p.append("*.cc")
|
||||
sources += glob.glob(os.path.join(*p))
|
||||
|
||||
for i in includes:
|
||||
p = i.split("/")
|
||||
if len(p) > 0 and p[0] == "":
|
||||
del p[0]
|
||||
else:
|
||||
p = [ src_path ] + p
|
||||
include_dirs.append(os.path.join(*p))
|
||||
|
||||
if is_library:
|
||||
ext = Library(mod_path,
|
||||
define_macros=define_macros,
|
||||
include_dirs=include_dirs,
|
||||
extra_objects=extra_objects,
|
||||
language="c++",
|
||||
libraries=self.libraries(header),
|
||||
extra_link_args=self.link_args(header, True),
|
||||
extra_compile_args=self.compile_args(header),
|
||||
sources=sources)
|
||||
self.add_extension(ext)
|
||||
else:
|
||||
ext = Extension(mod_path,
|
||||
define_macros=define_macros,
|
||||
include_dirs=include_dirs,
|
||||
extra_objects=extra_objects,
|
||||
extra_link_args=self.link_args(header, False),
|
||||
extra_compile_args=self.compile_args(header),
|
||||
sources=sources)
|
||||
|
||||
self.modules.append(ext)
|
||||
|
||||
return True
|
||||
|
||||
def src_path(self, name):
|
||||
return self.src_paths[name]
|
||||
|
||||
def add_extension(self, ext):
|
||||
self.build_ext_cmd.ext_map[ext.name] = ext
|
||||
|
||||
|
|
@ -312,65 +439,85 @@ class Config(object):
|
|||
ext_filename = ext_filename.replace(".so", ".dylib")
|
||||
return ext_filename
|
||||
|
||||
def path_of(self, mod, mod_src_path):
|
||||
def path_of(self, mod):
|
||||
"""
|
||||
Returns the build path of the library for a given module
|
||||
"""
|
||||
if platform.system() == "Windows":
|
||||
# On Windows, the library to link is the import library
|
||||
(dll_name, dll_ext) = os.path.splitext(self.libname_of(mod))
|
||||
return os.path.join(self.build_temp, mod_src_path, dll_name + ".lib")
|
||||
return os.path.join(self.build_temp, self.src_path(mod), dll_name + ".lib")
|
||||
else:
|
||||
return os.path.join(self.build_platlib, self.root, self.libname_of(mod))
|
||||
|
||||
def compile_args(self, mod):
|
||||
def sources(self, mod):
|
||||
"""
|
||||
Gets the source files for the given module and root source path
|
||||
"""
|
||||
return glob.glob(os.path.join(self.src_path(mod), "*.cc"))
|
||||
|
||||
def compile_args(self, options):
|
||||
"""
|
||||
Gets additional compiler arguments
|
||||
"""
|
||||
args: List[str]
|
||||
args = []
|
||||
args += options.get("cxxflags", [])
|
||||
if platform.system() == "Windows":
|
||||
bits = os.getenv("KLAYOUT_BITS")
|
||||
if bits:
|
||||
args = [
|
||||
args += [
|
||||
quote_path("-I" + os.path.join(bits, "zlib", "include")),
|
||||
quote_path("-I" + os.path.join(bits, "ptw", "include")),
|
||||
quote_path("-I" + os.path.join(bits, "png", "include")),
|
||||
quote_path("-I" + os.path.join(bits, "expat", "include")),
|
||||
quote_path("-I" + os.path.join(bits, "curl", "include")),
|
||||
]
|
||||
else:
|
||||
args = []
|
||||
args += options.get("cxxflags-msvc", [])
|
||||
args += options.get("cxxflags-win32", [])
|
||||
else:
|
||||
args = [
|
||||
"-Wno-strict-aliasing", # Avoids many "type-punned pointer" warnings
|
||||
"-std=c++11", # because we use unordered_map/unordered_set
|
||||
]
|
||||
if platform.system() == "Darwin" and mod == "_tl":
|
||||
if check_libpng():
|
||||
args += libpng_cflags()
|
||||
return args
|
||||
args += options.get("cxxflags-gcc", [])
|
||||
if platform.system() == "Darwin":
|
||||
args += options.get("cxxflags-darwin", [])
|
||||
else:
|
||||
args += options.get("cxxflags-linux", [])
|
||||
|
||||
def libraries(self, mod):
|
||||
result = []
|
||||
for a in args:
|
||||
if a == "$libpng_cflags":
|
||||
if check_libpng():
|
||||
result += libpng_cflags()
|
||||
else:
|
||||
result.append(a)
|
||||
return result
|
||||
|
||||
def libraries(self, options):
|
||||
"""
|
||||
Gets the libraries to add
|
||||
"""
|
||||
libs = []
|
||||
libs += options.get("libraries", [])
|
||||
if platform.system() == "Windows":
|
||||
if mod == "_tl":
|
||||
return ["libcurl", "expat", "pthreadVCE2", "zlib", "wsock32", "libpng16"]
|
||||
elif platform.system() == "Darwin":
|
||||
if mod == "_tl":
|
||||
libs = ["curl", "expat"] # libpng is included by libpng_ldflags
|
||||
return libs
|
||||
libs += options.get("libraries-msvc", [])
|
||||
libs += options.get("libraries-win32", [])
|
||||
else:
|
||||
if mod == "_tl":
|
||||
libs = ["curl", "expat", "png"]
|
||||
return libs
|
||||
return []
|
||||
libs += options.get("libraries-gcc", [])
|
||||
if platform.system() == "Darwin":
|
||||
libs += options.get("libraries-darwin", [])
|
||||
else:
|
||||
libs += options.get("libraries-linux", [])
|
||||
return libs
|
||||
|
||||
def link_args(self, mod):
|
||||
def link_args(self, options, is_library):
|
||||
"""
|
||||
Gets additional linker arguments
|
||||
"""
|
||||
mod = options["name"]
|
||||
args = []
|
||||
args += options.get("ldflags", [])
|
||||
if platform.system() == "Windows":
|
||||
args = ["/DLL"]
|
||||
bits = os.getenv("KLAYOUT_BITS")
|
||||
|
|
@ -382,20 +529,20 @@ class Config(object):
|
|||
quote_path("/LIBPATH:" + os.path.join(bits, "expat", "libraries")),
|
||||
quote_path("/LIBPATH:" + os.path.join(bits, "curl", "libraries")),
|
||||
]
|
||||
return args
|
||||
args += options.get("ldflags-msvc", [])
|
||||
args += options.get("ldflags-win32", [])
|
||||
elif platform.system() == "Darwin":
|
||||
# For the dependency modules, make sure we produce a dylib.
|
||||
# We can only link against such, but the bundles produced otherwise.
|
||||
args = []
|
||||
if mod[0] == "_":
|
||||
if is_library:
|
||||
args += [
|
||||
"-Wl,-dylib",
|
||||
"-Wl,-install_name,@rpath/%s" % self.libname_of(mod, is_lib=True),
|
||||
]
|
||||
args += ["-Wl,-rpath,@loader_path/"]
|
||||
if mod == "_tl" and check_libpng():
|
||||
args += libpng_ldflags()
|
||||
return args
|
||||
args += options.get("ldflags-gcc", [])
|
||||
args += options.get("ldflags-darwin", [])
|
||||
else:
|
||||
# this makes the libraries suitable for linking with a path -
|
||||
# i.e. from path_of('_tl'). Without this option, the path
|
||||
|
|
@ -404,16 +551,23 @@ class Config(object):
|
|||
# build path and the loader will fail.
|
||||
args = []
|
||||
args += ["-Wl,-soname," + self.libname_of(mod, is_lib=True)]
|
||||
if "_dbpi" not in mod:
|
||||
loader_path = "$ORIGIN"
|
||||
else:
|
||||
loader_path = "$ORIGIN/.."
|
||||
args += ["-Wl,-rpath," + loader_path]
|
||||
loader_path = ["$ORIGIN"] + [".."]*len(options.get("submodules", []))
|
||||
args += ["-Wl,-rpath," + "/".join(loader_path)]
|
||||
# default linux shared object compilation uses the '-g' flag,
|
||||
# which generates unnecessary debug information
|
||||
# removing with strip-all during the linking stage
|
||||
args += ["-Wl,--strip-all"]
|
||||
return args
|
||||
args += options.get("ldflags-gcc", [])
|
||||
args += options.get("ldflags-linux", [])
|
||||
|
||||
result = []
|
||||
for a in args:
|
||||
if a == "$libpng_ldflags":
|
||||
if check_libpng():
|
||||
result += libpng_ldflags()
|
||||
else:
|
||||
result.append(a)
|
||||
return result
|
||||
|
||||
def macros(self):
|
||||
"""
|
||||
|
|
@ -423,6 +577,7 @@ class Config(object):
|
|||
("HAVE_CURL", 1),
|
||||
("HAVE_EXPAT", 1),
|
||||
("HAVE_PNG", 1),
|
||||
("KLAYOUT_VERSION", self.version()),
|
||||
("KLAYOUT_MAJOR_VERSION", self.major_version()),
|
||||
("KLAYOUT_MINOR_VERSION", self.minor_version()),
|
||||
("GSI_ALIAS_INSPECT", 1),
|
||||
|
|
@ -488,535 +643,28 @@ class Config(object):
|
|||
|
||||
config = Config()
|
||||
|
||||
# ------------------------------------------------------------------
|
||||
# _tl dependency library
|
||||
|
||||
_tl_path = os.path.join("src", "tl", "tl")
|
||||
_tl_sources = set(glob.glob(os.path.join(_tl_path, "*.cc")))
|
||||
|
||||
# Exclude sources which are compatible with Qt only
|
||||
# Caveat, in source distribution tarballs from pypi, these files will
|
||||
# not exist. So we need an error-free discard method instead of list's remove.
|
||||
_tl_sources.discard(os.path.join(_tl_path, "tlHttpStreamQt.cc"))
|
||||
_tl_sources.discard(os.path.join(_tl_path, "tlHttpStreamNoQt.cc"))
|
||||
_tl_sources.discard(os.path.join(_tl_path, "tlFileSystemWatcher.cc"))
|
||||
_tl_sources.discard(os.path.join(_tl_path, "tlDeferredExecutionQt.cc"))
|
||||
|
||||
_tl = Library(
|
||||
config.root + "._tl",
|
||||
define_macros=config.macros() + [("MAKE_TL_LIBRARY", 1)],
|
||||
language="c++",
|
||||
libraries=config.libraries("_tl"),
|
||||
extra_link_args=config.link_args("_tl"),
|
||||
extra_compile_args=config.compile_args("_tl"),
|
||||
sources=list(_tl_sources),
|
||||
)
|
||||
|
||||
config.add_extension(_tl)
|
||||
|
||||
# ------------------------------------------------------------------
|
||||
# _gsi dependency library
|
||||
|
||||
_gsi_path = os.path.join("src", "gsi", "gsi")
|
||||
_gsi_sources = set(glob.glob(os.path.join(_gsi_path, "*.cc")))
|
||||
|
||||
_gsi = Library(
|
||||
config.root + "._gsi",
|
||||
define_macros=config.macros() + [("MAKE_GSI_LIBRARY", 1)],
|
||||
include_dirs=[_tl_path],
|
||||
extra_objects=[config.path_of("_tl", _tl_path)],
|
||||
language="c++",
|
||||
libraries=config.libraries('_gsi'),
|
||||
extra_link_args=config.link_args("_gsi"),
|
||||
extra_compile_args=config.compile_args("_gsi"),
|
||||
sources=list(_gsi_sources),
|
||||
)
|
||||
config.add_extension(_gsi)
|
||||
|
||||
# ------------------------------------------------------------------
|
||||
# _pya dependency library
|
||||
|
||||
_pya_path = os.path.join("src", "pya", "pya")
|
||||
_pya_sources = set(glob.glob(os.path.join(_pya_path, "*.cc")))
|
||||
|
||||
_version_path = os.path.join("src", "version")
|
||||
|
||||
_pya = Library(
|
||||
config.root + "._pya",
|
||||
define_macros=config.macros() + [("MAKE_PYA_LIBRARY", 1), ("KLAYOUT_VERSION", config.version())],
|
||||
include_dirs=[_version_path, _tl_path, _gsi_path],
|
||||
extra_objects=[config.path_of("_tl", _tl_path), config.path_of("_gsi", _gsi_path)],
|
||||
language="c++",
|
||||
libraries=config.libraries('_pya'),
|
||||
extra_link_args=config.link_args("_pya"),
|
||||
extra_compile_args=config.compile_args("_pya"),
|
||||
sources=list(_pya_sources),
|
||||
)
|
||||
config.add_extension(_pya)
|
||||
|
||||
# ------------------------------------------------------------------
|
||||
# _rba dependency library (dummy)
|
||||
|
||||
_rba_path = os.path.join("src", "rbastub")
|
||||
_rba_sources = set(glob.glob(os.path.join(_rba_path, "*.cc")))
|
||||
|
||||
_rba = Library(
|
||||
config.root + '._rba',
|
||||
define_macros=config.macros() + [('MAKE_RBA_LIBRARY', 1)],
|
||||
include_dirs=[_tl_path, _gsi_path],
|
||||
extra_objects=[config.path_of('_tl', _tl_path), config.path_of('_gsi', _gsi_path)],
|
||||
language='c++',
|
||||
libraries=config.libraries('_rba'),
|
||||
extra_link_args=config.link_args('_rba'),
|
||||
extra_compile_args=config.compile_args('_rba'),
|
||||
sources=list(_rba_sources)
|
||||
)
|
||||
config.add_extension(_rba)
|
||||
|
||||
# ------------------------------------------------------------------
|
||||
# _db dependency library
|
||||
|
||||
_db_path = os.path.join("src", "db", "db")
|
||||
_db_sources = set(glob.glob(os.path.join(_db_path, "*.cc")))
|
||||
|
||||
_db = Library(
|
||||
config.root + "._db",
|
||||
define_macros=config.macros() + [("MAKE_DB_LIBRARY", 1)],
|
||||
include_dirs=[_tl_path, _gsi_path, _db_path],
|
||||
extra_objects=[config.path_of("_tl", _tl_path), config.path_of("_gsi", _gsi_path)],
|
||||
language="c++",
|
||||
libraries=config.libraries('_db'),
|
||||
extra_link_args=config.link_args("_db"),
|
||||
extra_compile_args=config.compile_args("_db"),
|
||||
sources=list(_db_sources),
|
||||
)
|
||||
config.add_extension(_db)
|
||||
|
||||
# ------------------------------------------------------------------
|
||||
# _pex dependency library
|
||||
|
||||
_pex_path = os.path.join("src", "pex", "pex")
|
||||
_pex_sources = set(glob.glob(os.path.join(_pex_path, "*.cc")))
|
||||
|
||||
_pex = Library(
|
||||
config.root + "._pex",
|
||||
define_macros=config.macros() + [("MAKE_PEX_LIBRARY", 1)],
|
||||
include_dirs=[_tl_path, _gsi_path, _db_path, _pex_path],
|
||||
extra_objects=[config.path_of("_tl", _tl_path), config.path_of("_gsi", _gsi_path), config.path_of("_db", _db_path)],
|
||||
language="c++",
|
||||
libraries=config.libraries('_pex'),
|
||||
extra_link_args=config.link_args("_pex"),
|
||||
extra_compile_args=config.compile_args("_pex"),
|
||||
sources=list(_pex_sources),
|
||||
)
|
||||
config.add_extension(_pex)
|
||||
|
||||
# ------------------------------------------------------------------
|
||||
# _lib dependency library
|
||||
|
||||
_lib_path = os.path.join("src", "lib", "lib")
|
||||
_lib_sources = set(glob.glob(os.path.join(_lib_path, "*.cc")))
|
||||
|
||||
_lib = Library(
|
||||
config.root + "._lib",
|
||||
define_macros=config.macros() + [("MAKE_LIB_LIBRARY", 1)],
|
||||
include_dirs=[_tl_path, _gsi_path, _db_path, _lib_path],
|
||||
extra_objects=[
|
||||
config.path_of("_tl", _tl_path),
|
||||
config.path_of("_gsi", _gsi_path),
|
||||
config.path_of("_db", _db_path),
|
||||
],
|
||||
language="c++",
|
||||
libraries=config.libraries('_lib'),
|
||||
extra_link_args=config.link_args("_lib"),
|
||||
extra_compile_args=config.compile_args("_lib"),
|
||||
sources=list(_lib_sources),
|
||||
)
|
||||
config.add_extension(_lib)
|
||||
|
||||
# ------------------------------------------------------------------
|
||||
# _rdb dependency library
|
||||
|
||||
_rdb_path = os.path.join("src", "rdb", "rdb")
|
||||
_rdb_sources = set(glob.glob(os.path.join(_rdb_path, "*.cc")))
|
||||
|
||||
_rdb = Library(
|
||||
config.root + "._rdb",
|
||||
define_macros=config.macros() + [("MAKE_RDB_LIBRARY", 1)],
|
||||
include_dirs=[_db_path, _tl_path, _gsi_path],
|
||||
extra_objects=[
|
||||
config.path_of("_tl", _tl_path),
|
||||
config.path_of("_gsi", _gsi_path),
|
||||
config.path_of("_db", _db_path),
|
||||
],
|
||||
language="c++",
|
||||
libraries=config.libraries('_rdb'),
|
||||
extra_link_args=config.link_args("_rdb"),
|
||||
extra_compile_args=config.compile_args("_rdb"),
|
||||
sources=list(_rdb_sources),
|
||||
)
|
||||
config.add_extension(_rdb)
|
||||
|
||||
# ------------------------------------------------------------------
|
||||
# _laybasic dependency library
|
||||
|
||||
_laybasic_path = os.path.join("src", "laybasic", "laybasic")
|
||||
_laybasic_sources = set(glob.glob(os.path.join(_laybasic_path, "*.cc")))
|
||||
|
||||
_laybasic = Library(
|
||||
config.root + '._laybasic',
|
||||
define_macros=config.macros() + [('MAKE_LAYBASIC_LIBRARY', 1)],
|
||||
include_dirs=[_rdb_path, _db_path, _tl_path, _gsi_path],
|
||||
extra_objects=[
|
||||
config.path_of('_rdb', _rdb_path),
|
||||
config.path_of('_tl', _tl_path),
|
||||
config.path_of('_gsi', _gsi_path),
|
||||
config.path_of('_db', _db_path)
|
||||
],
|
||||
language='c++',
|
||||
libraries=config.libraries('_laybasic'),
|
||||
extra_link_args=config.link_args('_laybasic'),
|
||||
extra_compile_args=config.compile_args('_laybasic'),
|
||||
sources=list(_laybasic_sources)
|
||||
)
|
||||
config.add_extension(_laybasic)
|
||||
|
||||
# ------------------------------------------------------------------
|
||||
# _layview dependency library
|
||||
|
||||
_layview_path = os.path.join("src", "layview", "layview")
|
||||
_layview_sources = set(glob.glob(os.path.join(_layview_path, "*.cc")))
|
||||
|
||||
_layview = Library(
|
||||
config.root + '._layview',
|
||||
define_macros=config.macros() + [('MAKE_LAYVIEW_LIBRARY', 1)],
|
||||
include_dirs=[_laybasic_path, _rdb_path, _db_path, _tl_path, _gsi_path],
|
||||
extra_objects=[
|
||||
config.path_of('_laybasic', _laybasic_path),
|
||||
config.path_of('_rdb', _rdb_path),
|
||||
config.path_of('_tl', _tl_path),
|
||||
config.path_of('_gsi', _gsi_path),
|
||||
config.path_of('_db', _db_path)
|
||||
],
|
||||
language='c++',
|
||||
libraries=config.libraries('_layview'),
|
||||
extra_link_args=config.link_args('_layview'),
|
||||
extra_compile_args=config.compile_args('_layview'),
|
||||
sources=list(_layview_sources)
|
||||
)
|
||||
config.add_extension(_layview)
|
||||
|
||||
# ------------------------------------------------------------------
|
||||
# _lym dependency library
|
||||
|
||||
_lym_path = os.path.join("src", "lym", "lym")
|
||||
_lym_sources = set(glob.glob(os.path.join(_lym_path, "*.cc")))
|
||||
|
||||
_lym = Library(
|
||||
config.root + '._lym',
|
||||
define_macros=config.macros() + [('MAKE_LYM_LIBRARY', 1)],
|
||||
include_dirs=[_pya_path, _rba_path, _tl_path, _gsi_path],
|
||||
extra_objects=[
|
||||
config.path_of('_rba', _rba_path),
|
||||
config.path_of('_pya', _pya_path),
|
||||
config.path_of('_tl', _tl_path),
|
||||
config.path_of('_gsi', _gsi_path)
|
||||
],
|
||||
language='c++',
|
||||
libraries=config.libraries('_lym'),
|
||||
extra_link_args=config.link_args('_lym'),
|
||||
extra_compile_args=config.compile_args('_lym'),
|
||||
sources=list(_lym_sources)
|
||||
)
|
||||
config.add_extension(_lym)
|
||||
|
||||
# ------------------------------------------------------------------
|
||||
# _ant dependency library
|
||||
|
||||
_ant_path = os.path.join("src", "ant", "ant")
|
||||
_ant_sources = set(glob.glob(os.path.join(_ant_path, "*.cc")))
|
||||
|
||||
_ant = Library(
|
||||
config.root + '._ant',
|
||||
define_macros=config.macros() + [('MAKE_ANT_LIBRARY', 1)],
|
||||
include_dirs=[_laybasic_path, _layview_path, _rdb_path, _db_path, _tl_path, _gsi_path],
|
||||
extra_objects=[
|
||||
config.path_of('_laybasic', _laybasic_path),
|
||||
config.path_of('_layview', _layview_path),
|
||||
config.path_of('_rdb', _rdb_path),
|
||||
config.path_of('_tl', _tl_path),
|
||||
config.path_of('_gsi', _gsi_path),
|
||||
config.path_of('_db', _db_path)
|
||||
],
|
||||
language='c++',
|
||||
libraries=config.libraries('_ant'),
|
||||
extra_link_args=config.link_args('_ant'),
|
||||
extra_compile_args=config.compile_args('_ant'),
|
||||
sources=list(_ant_sources)
|
||||
)
|
||||
config.add_extension(_ant)
|
||||
|
||||
# ------------------------------------------------------------------
|
||||
# _img dependency library
|
||||
|
||||
_img_path = os.path.join("src", "img", "img")
|
||||
_img_sources = set(glob.glob(os.path.join(_img_path, "*.cc")))
|
||||
|
||||
_img = Library(
|
||||
config.root + '._img',
|
||||
define_macros=config.macros() + [('MAKE_IMG_LIBRARY', 1)],
|
||||
include_dirs=[_laybasic_path, _layview_path, _rdb_path, _db_path, _tl_path, _gsi_path],
|
||||
extra_objects=[
|
||||
config.path_of('_laybasic', _laybasic_path),
|
||||
config.path_of('_layview', _layview_path),
|
||||
config.path_of('_rdb', _rdb_path),
|
||||
config.path_of('_tl', _tl_path),
|
||||
config.path_of('_gsi', _gsi_path),
|
||||
config.path_of('_db', _db_path)
|
||||
],
|
||||
language='c++',
|
||||
libraries=config.libraries('_img'),
|
||||
extra_link_args=config.link_args('_img'),
|
||||
extra_compile_args=config.compile_args('_img'),
|
||||
sources=list(_img_sources)
|
||||
)
|
||||
config.add_extension(_img)
|
||||
|
||||
# ------------------------------------------------------------------
|
||||
# _edt dependency library
|
||||
|
||||
_edt_path = os.path.join("src", "edt", "edt")
|
||||
_edt_sources = set(glob.glob(os.path.join(_edt_path, "*.cc")))
|
||||
|
||||
_edt = Library(
|
||||
config.root + '._edt',
|
||||
define_macros=config.macros() + [('MAKE_EDT_LIBRARY', 1)],
|
||||
include_dirs=[_laybasic_path, _layview_path, _rdb_path, _db_path, _tl_path, _gsi_path],
|
||||
extra_objects=[
|
||||
config.path_of('_laybasic', _laybasic_path),
|
||||
config.path_of('_layview', _layview_path),
|
||||
config.path_of('_rdb', _rdb_path),
|
||||
config.path_of('_tl', _tl_path),
|
||||
config.path_of('_gsi', _gsi_path),
|
||||
config.path_of('_db', _db_path)
|
||||
],
|
||||
language='c++',
|
||||
libraries=config.libraries('_edt'),
|
||||
extra_link_args=config.link_args('_edt'),
|
||||
extra_compile_args=config.compile_args('_edt'),
|
||||
sources=list(_edt_sources)
|
||||
)
|
||||
config.add_extension(_edt)
|
||||
|
||||
# ------------------------------------------------------------------
|
||||
# dependency libraries from db_plugins
|
||||
|
||||
db_plugins = []
|
||||
|
||||
dbpi_dirs = glob.glob(os.path.join("src", "plugins", "*", "db_plugin"))
|
||||
dbpi_dirs += glob.glob(os.path.join("src", "plugins", "*", "*", "db_plugin"))
|
||||
|
||||
for pi in dbpi_dirs:
|
||||
|
||||
mod_name = "_" + os.path.split(os.path.split(pi)[-2])[-1] + "_dbpi"
|
||||
|
||||
pi_sources = glob.glob(os.path.join(pi, "*.cc"))
|
||||
pi_sources += glob.glob(os.path.join(pi, "contrib", "*.cc"))
|
||||
|
||||
pi_ext = Library(
|
||||
config.root + ".db_plugins." + mod_name,
|
||||
define_macros=config.macros() + [("MAKE_DB_PLUGIN_LIBRARY", 1)],
|
||||
include_dirs=[
|
||||
pi,
|
||||
os.path.join("src", "plugins", "common"),
|
||||
_db_path,
|
||||
_tl_path,
|
||||
_gsi_path,
|
||||
],
|
||||
extra_objects=[
|
||||
config.path_of("_tl", _tl_path),
|
||||
config.path_of("_gsi", _gsi_path),
|
||||
config.path_of("_db", _db_path),
|
||||
],
|
||||
language="c++",
|
||||
extra_link_args=config.link_args(mod_name),
|
||||
extra_compile_args=config.compile_args(mod_name),
|
||||
sources=pi_sources,
|
||||
)
|
||||
|
||||
db_plugins.append(pi_ext)
|
||||
config.add_extension(pi_ext)
|
||||
|
||||
# ------------------------------------------------------------------
|
||||
# tl extension library
|
||||
|
||||
tl_path = os.path.join("src", "pymod", "tl")
|
||||
tl_sources = set(glob.glob(os.path.join(tl_path, "*.cc")))
|
||||
|
||||
tl = Extension(
|
||||
config.root + ".tlcore",
|
||||
define_macros=config.macros(),
|
||||
include_dirs=[_tl_path, _gsi_path, _pya_path],
|
||||
extra_objects=[
|
||||
config.path_of("_tl", _tl_path),
|
||||
config.path_of("_gsi", _gsi_path),
|
||||
config.path_of("_pya", _pya_path),
|
||||
],
|
||||
extra_link_args=config.link_args("tlcore"),
|
||||
extra_compile_args=config.compile_args("tlcore"),
|
||||
sources=list(tl_sources),
|
||||
)
|
||||
|
||||
# ------------------------------------------------------------------
|
||||
# db extension library
|
||||
|
||||
db_path = os.path.join("src", "pymod", "db")
|
||||
db_sources = set(glob.glob(os.path.join(db_path, "*.cc")))
|
||||
|
||||
db = Extension(
|
||||
config.root + ".dbcore",
|
||||
define_macros=config.macros(),
|
||||
include_dirs=[_db_path, _tl_path, _gsi_path, _pya_path],
|
||||
extra_objects=[
|
||||
config.path_of("_db", _db_path),
|
||||
config.path_of("_tl", _tl_path),
|
||||
config.path_of("_gsi", _gsi_path),
|
||||
config.path_of("_pya", _pya_path),
|
||||
],
|
||||
extra_link_args=config.link_args("dbcore"),
|
||||
extra_compile_args=config.compile_args("dbcore"),
|
||||
sources=list(db_sources),
|
||||
)
|
||||
|
||||
# ------------------------------------------------------------------
|
||||
# pex extension library
|
||||
|
||||
pex_path = os.path.join("src", "pymod", "pex")
|
||||
pex_sources = set(glob.glob(os.path.join(pex_path, "*.cc")))
|
||||
|
||||
pex = Extension(
|
||||
config.root + ".pexcore",
|
||||
define_macros=config.macros(),
|
||||
include_dirs=[_db_path, _tl_path, _gsi_path, _pya_path, _pex_path],
|
||||
extra_objects=[
|
||||
config.path_of("_db", _db_path),
|
||||
config.path_of("_pex", _pex_path),
|
||||
config.path_of("_tl", _tl_path),
|
||||
config.path_of("_gsi", _gsi_path),
|
||||
config.path_of("_pya", _pya_path),
|
||||
],
|
||||
extra_link_args=config.link_args("pexcore"),
|
||||
extra_compile_args=config.compile_args("pexcore"),
|
||||
sources=list(pex_sources),
|
||||
)
|
||||
|
||||
# ------------------------------------------------------------------
|
||||
# lib extension library
|
||||
|
||||
lib_path = os.path.join("src", "pymod", "lib")
|
||||
lib_sources = set(glob.glob(os.path.join(lib_path, "*.cc")))
|
||||
|
||||
lib = Extension(
|
||||
config.root + ".libcore",
|
||||
define_macros=config.macros(),
|
||||
include_dirs=[_lib_path, _tl_path, _gsi_path, _pya_path],
|
||||
extra_objects=[
|
||||
config.path_of("_lib", _lib_path),
|
||||
config.path_of("_tl", _tl_path),
|
||||
config.path_of("_gsi", _gsi_path),
|
||||
config.path_of("_pya", _pya_path),
|
||||
],
|
||||
extra_link_args=config.link_args("libcore"),
|
||||
extra_compile_args=config.compile_args("libcore"),
|
||||
sources=list(lib_sources),
|
||||
)
|
||||
|
||||
# ------------------------------------------------------------------
|
||||
# rdb extension library
|
||||
|
||||
rdb_path = os.path.join("src", "pymod", "rdb")
|
||||
rdb_sources = set(glob.glob(os.path.join(rdb_path, "*.cc")))
|
||||
|
||||
rdb = Extension(
|
||||
config.root + ".rdbcore",
|
||||
define_macros=config.macros(),
|
||||
include_dirs=[_rdb_path, _tl_path, _gsi_path, _pya_path],
|
||||
extra_objects=[
|
||||
config.path_of("_rdb", _rdb_path),
|
||||
config.path_of("_tl", _tl_path),
|
||||
config.path_of("_gsi", _gsi_path),
|
||||
config.path_of("_pya", _pya_path),
|
||||
],
|
||||
extra_link_args=config.link_args("rdbcore"),
|
||||
extra_compile_args=config.compile_args("rdbcore"),
|
||||
sources=list(rdb_sources),
|
||||
)
|
||||
|
||||
# ------------------------------------------------------------------
|
||||
# lay extension library
|
||||
|
||||
lay_path = os.path.join("src", "pymod", "lay")
|
||||
lay_sources = set(glob.glob(os.path.join(lay_path, "*.cc")))
|
||||
|
||||
lay = Extension(config.root + '.laycore',
|
||||
define_macros=config.macros(),
|
||||
include_dirs=[_laybasic_path,
|
||||
_layview_path,
|
||||
_img_path,
|
||||
_ant_path,
|
||||
_edt_path,
|
||||
_lym_path,
|
||||
_tl_path,
|
||||
_gsi_path,
|
||||
_pya_path],
|
||||
extra_objects=[config.path_of('_laybasic', _laybasic_path),
|
||||
config.path_of('_layview', _layview_path),
|
||||
config.path_of('_img', _img_path),
|
||||
config.path_of('_ant', _ant_path),
|
||||
config.path_of('_edt', _edt_path),
|
||||
config.path_of('_lym', _lym_path),
|
||||
config.path_of('_tl', _tl_path),
|
||||
config.path_of('_gsi', _gsi_path),
|
||||
config.path_of('_pya', _pya_path)],
|
||||
extra_link_args=config.link_args('laycore'),
|
||||
extra_compile_args=config.compile_args('laycore'),
|
||||
sources=list(lay_sources))
|
||||
|
||||
# ------------------------------------------------------------------
|
||||
# pya extension library (all inclusive, basis of pya module)
|
||||
|
||||
pyacore_path = os.path.join("src", "pymod", "pya")
|
||||
pyacore_sources = set(glob.glob(os.path.join(pyacore_path, "*.cc")))
|
||||
|
||||
pya = Extension(config.root + '.pyacore',
|
||||
define_macros=config.macros(),
|
||||
include_dirs=[_laybasic_path,
|
||||
_layview_path,
|
||||
_lib_path,
|
||||
_db_path,
|
||||
_rdb_path,
|
||||
_img_path,
|
||||
_ant_path,
|
||||
_edt_path,
|
||||
_lym_path,
|
||||
_tl_path,
|
||||
_gsi_path,
|
||||
_pya_path],
|
||||
extra_objects=[config.path_of('_laybasic', _laybasic_path),
|
||||
config.path_of('_layview', _layview_path),
|
||||
config.path_of('_lib', _lib_path),
|
||||
config.path_of('_db', _db_path),
|
||||
config.path_of('_rdb', _rdb_path),
|
||||
config.path_of('_img', _img_path),
|
||||
config.path_of('_ant', _ant_path),
|
||||
config.path_of('_edt', _edt_path),
|
||||
config.path_of('_lym', _lym_path),
|
||||
config.path_of('_tl', _tl_path),
|
||||
config.path_of('_gsi', _gsi_path),
|
||||
config.path_of('_pya', _pya_path)],
|
||||
extra_link_args=config.link_args('pyacore'),
|
||||
extra_compile_args=config.compile_args('pyacore'),
|
||||
sources=list(pyacore_sources))
|
||||
# Collect the module spec files with dependent modules coming after
|
||||
# the dependencies:
|
||||
|
||||
mod_specs = glob.glob(os.path.join("src", "*", "pysetup.toml"))
|
||||
mod_specs += glob.glob(os.path.join("src", "*", "*", "pysetup.toml"))
|
||||
mod_specs += glob.glob(os.path.join("src", "*", "*", "*", "pysetup.toml"))
|
||||
mod_specs += glob.glob(os.path.join("src", "*", "*", "*", "*", "pysetup.toml"))
|
||||
|
||||
todo = mod_specs
|
||||
while len(todo) > 0:
|
||||
|
||||
not_done = []
|
||||
for ms in todo:
|
||||
p = list(os.path.split(ms))
|
||||
p.pop()
|
||||
if not config.module(None, os.path.join(*p)):
|
||||
not_done.append(ms)
|
||||
|
||||
if len(not_done) == len(todo):
|
||||
raise RuntimeError("Dependency resolution failed - circular dependencies?")
|
||||
|
||||
todo = not_done
|
||||
|
||||
# ------------------------------------------------------------------
|
||||
# Core setup function
|
||||
|
|
@ -1032,7 +680,7 @@ if __name__ == "__main__":
|
|||
description="KLayout standalone Python package",
|
||||
long_description="This package is a standalone distribution of KLayout's Python API.\n\nFor more details see here: https://www.klayout.org/klayout-pypi",
|
||||
author="Matthias Koefferlein",
|
||||
author_email="matthias@klayout.de",
|
||||
author_email="matthias@klayout.org",
|
||||
classifiers=[
|
||||
# Recommended classifiers
|
||||
"Programming Language :: Python :: 2",
|
||||
|
|
@ -1051,8 +699,6 @@ if __name__ == "__main__":
|
|||
package_data={config.root: ["src/pymod/distutils_src/klayout/*.pyi"]},
|
||||
data_files=[(config.root, ["src/pymod/distutils_src/klayout/py.typed"])],
|
||||
include_package_data=True,
|
||||
ext_modules=[_tl, _gsi, _pya, _rba, _db, _pex, _lib, _rdb, _lym, _laybasic, _layview, _ant, _edt, _img]
|
||||
+ db_plugins
|
||||
+ [tl, db, pex, lib, rdb, lay, pya],
|
||||
ext_modules=config.modules,
|
||||
cmdclass={'build_ext': klayout_build_ext}
|
||||
)
|
||||
|
|
|
|||
|
|
@ -0,0 +1,6 @@
|
|||
|
||||
[library]
|
||||
name = "_ant"
|
||||
defines = [["MAKE_ANT_LIBRARY", 1]]
|
||||
depends = ["_tl", "_gsi", "_db", "_rdb", "_laybasic", "_layview"]
|
||||
|
||||
|
|
@ -14,6 +14,7 @@ SOURCES = \
|
|||
strm2cif.cc \
|
||||
strm2gds.cc \
|
||||
strm2oas.cc \
|
||||
strm2lstr.cc \
|
||||
strmclip.cc \
|
||||
strm2dxf.cc \
|
||||
strm2gdstxt.cc \
|
||||
|
|
|
|||
|
|
@ -84,11 +84,16 @@ GenericWriterOptions::init_from_options (const db::SaveLayoutOptions &save_optio
|
|||
m_magic_lambda = 1.0;
|
||||
|
||||
m_dxf_polygon_mode = save_options.get_option_by_name ("dxf_polygon_mode").to_int ();
|
||||
|
||||
m_lstream_compression_level = save_options.get_option_by_name ("lstream_compression_level").to_int ();
|
||||
m_lstream_recompress = save_options.get_option_by_name ("lstream_recompress").to_bool ();
|
||||
m_lstream_permissive = save_options.get_option_by_name ("lstream_permissive").to_bool ();
|
||||
}
|
||||
|
||||
const std::string GenericWriterOptions::gds2_format_name = "GDS2";
|
||||
const std::string GenericWriterOptions::gds2text_format_name = "GDS2Text"; // no special options
|
||||
const std::string GenericWriterOptions::oasis_format_name = "OASIS";
|
||||
const std::string GenericWriterOptions::lstream_format_name = "LStream";
|
||||
const std::string GenericWriterOptions::dxf_format_name = "DXF";
|
||||
const std::string GenericWriterOptions::cif_format_name = "CIF";
|
||||
const std::string GenericWriterOptions::mag_format_name = "MAG";
|
||||
|
|
@ -277,6 +282,34 @@ GenericWriterOptions::add_options (tl::CommandLineOptions &cmd, const std::strin
|
|||
|
||||
}
|
||||
|
||||
if (format.empty () || format == lstream_format_name) {
|
||||
|
||||
// Add LStream format options
|
||||
std::string group = "[Output options - LStream specific]";
|
||||
|
||||
cmd << tl::arg (group +
|
||||
"-oc|--lstr-compression-level=level", &m_lstream_compression_level, "Specifies the LStream compression level",
|
||||
"This level describes how hard the LStream writer will try to compress the shapes "
|
||||
"using shape arrays. Building shape arrays may take some time and requires some memory. "
|
||||
"The default compression level is 2.\n"
|
||||
"* 0 - no shape array building\n"
|
||||
"* 1 - nearest neighbor shape array formation\n"
|
||||
"* 2++ - enhanced shape array search algorithm using 2nd and further neighbor distances as well\n"
|
||||
)
|
||||
<< tl::arg (group +
|
||||
"#--lstr-recompress", &m_lstream_recompress, "Compresses shape arrays again",
|
||||
"With this option, shape arrays will be expanded and recompressed. This may result in a better "
|
||||
"compression ratio, but at the cost of slower execution."
|
||||
)
|
||||
<< tl::arg (group +
|
||||
"#--lstr-permissive", &m_lstream_permissive, "Permissive mode",
|
||||
"In permissive mode, certain forbidden objects are reported as warnings, not as errors: "
|
||||
"paths with odd width, polygons with less than three points etc."
|
||||
)
|
||||
;
|
||||
|
||||
}
|
||||
|
||||
if (format.empty () || format == dxf_format_name) {
|
||||
|
||||
// Add DXF format options
|
||||
|
|
@ -418,6 +451,10 @@ GenericWriterOptions::configure (db::SaveLayoutOptions &save_options, const db::
|
|||
|
||||
save_options.set_option_by_name ("dxf_polygon_mode", m_dxf_polygon_mode);
|
||||
|
||||
save_options.set_option_by_name ("lstream_compression_level", m_lstream_compression_level);
|
||||
save_options.set_option_by_name ("lstream_recompress", m_lstream_recompress);
|
||||
save_options.set_option_by_name ("lstream_permissive", m_lstream_permissive);
|
||||
|
||||
save_options.set_option_by_name ("mag_lambda", m_magic_lambda);
|
||||
save_options.set_option_by_name ("mag_tech", m_magic_tech);
|
||||
|
||||
|
|
|
|||
|
|
@ -108,6 +108,7 @@ public:
|
|||
static const std::string gds2_format_name;
|
||||
static const std::string gds2text_format_name;
|
||||
static const std::string oasis_format_name;
|
||||
static const std::string lstream_format_name;
|
||||
static const std::string cif_format_name;
|
||||
static const std::string dxf_format_name;
|
||||
static const std::string mag_format_name;
|
||||
|
|
@ -148,6 +149,10 @@ private:
|
|||
|
||||
int m_dxf_polygon_mode;
|
||||
|
||||
int m_lstream_compression_level;
|
||||
bool m_lstream_recompress;
|
||||
bool m_lstream_permissive;
|
||||
|
||||
void set_oasis_substitution_char (const std::string &text);
|
||||
void init_from_options (const db::SaveLayoutOptions &options);
|
||||
};
|
||||
|
|
|
|||
|
|
@ -0,0 +1,29 @@
|
|||
|
||||
/*
|
||||
|
||||
KLayout Layout Viewer
|
||||
Copyright (C) 2006-2025 Matthias Koefferlein
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
*/
|
||||
|
||||
#include "bdConverterMain.h"
|
||||
#include "bdWriterOptions.h"
|
||||
|
||||
BD_PUBLIC int strm2lstr (int argc, char *argv[])
|
||||
{
|
||||
return bd::converter_main (argc, argv, bd::GenericWriterOptions::lstream_format_name);
|
||||
}
|
||||
|
|
@ -8,6 +8,7 @@ SUBDIRS = \
|
|||
strm2gds \
|
||||
strm2gdstxt \
|
||||
strm2oas \
|
||||
strm2lstr \
|
||||
strm2mag \
|
||||
strm2txt \
|
||||
strmclip \
|
||||
|
|
@ -20,6 +21,7 @@ strm2dxf.depends += bd
|
|||
strm2gds.depends += bd
|
||||
strm2gdstxt.depends += bd
|
||||
strm2oas.depends += bd
|
||||
strm2lstr.depends += bd
|
||||
strm2mag.depends += bd
|
||||
strm2txt.depends += bd
|
||||
strmclip.depends += bd
|
||||
|
|
|
|||
|
|
@ -0,0 +1,2 @@
|
|||
|
||||
include($$PWD/../buddy_app.pri)
|
||||
|
|
@ -187,6 +187,31 @@ TEST(6)
|
|||
db::compare_layouts (this, layout, input_au, db::WriteGDS2);
|
||||
}
|
||||
|
||||
// Testing the converter main implementation (LStream)
|
||||
TEST(7)
|
||||
{
|
||||
std::string input = tl::testdata ();
|
||||
input += "/gds/t10.gds";
|
||||
|
||||
std::string output = this->tmp_file ();
|
||||
|
||||
const char *argv[] = { "x", input.c_str (), output.c_str () };
|
||||
|
||||
EXPECT_EQ (bd::converter_main (sizeof (argv) / sizeof (argv[0]), (char **) argv, bd::GenericWriterOptions::lstream_format_name), 0);
|
||||
|
||||
db::Layout layout;
|
||||
|
||||
{
|
||||
tl::InputStream stream (output);
|
||||
db::LoadLayoutOptions options;
|
||||
db::Reader reader (stream);
|
||||
reader.read (layout, options);
|
||||
EXPECT_EQ (reader.format (), "LStream");
|
||||
}
|
||||
|
||||
db::compare_layouts (this, layout, input, db::NoNormalization);
|
||||
}
|
||||
|
||||
// Large LEF/DEF to OAS converter test
|
||||
TEST(10)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -149,7 +149,15 @@ void
|
|||
Library::rename (const std::string &name)
|
||||
{
|
||||
if (name != get_name () && db::LibraryManager::initialized ()) {
|
||||
|
||||
std::pair<bool, lib_id_type> n2l = db::LibraryManager::instance ().lib_by_name (name, get_technologies ());
|
||||
if (n2l.first && n2l.second != get_id ()) {
|
||||
// remove any existing library that has our target name/tech combination
|
||||
db::LibraryManager::instance ().delete_lib (db::LibraryManager::instance ().lib (n2l.second));
|
||||
}
|
||||
|
||||
db::LibraryManager::instance ().rename (get_id (), name);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -110,6 +110,17 @@ Vertex::is_outside () const
|
|||
return false;
|
||||
}
|
||||
|
||||
bool
|
||||
Vertex::is_on_outline () const
|
||||
{
|
||||
for (auto e = mp_edges.begin (); e != mp_edges.end (); ++e) {
|
||||
if ((*e)->is_segment ()) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void
|
||||
Vertex::set_is_precious (bool f, unsigned int id)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -96,6 +96,11 @@ public:
|
|||
*/
|
||||
bool is_outside () const;
|
||||
|
||||
/**
|
||||
* @brief Gets a value indicating whether is on the outline - i.e. one edge is a segment
|
||||
*/
|
||||
bool is_on_outline () const;
|
||||
|
||||
/**
|
||||
* @brief Gets a list of polygons that are attached to this vertex
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -31,6 +31,8 @@
|
|||
#include <vector>
|
||||
#include <map>
|
||||
|
||||
// #define DEBUG_DUMP_ESSENTIAL_EDGES
|
||||
|
||||
namespace db
|
||||
{
|
||||
|
||||
|
|
@ -286,65 +288,134 @@ ConvexDecomposition::hertel_mehlhorn_decomposition (Triangulation &tris, const C
|
|||
// them one-by-one, but using them in length order, from the
|
||||
|
||||
std::unordered_set<const Edge *> essential_edges;
|
||||
std::unordered_set<const Vertex *> concave_vertexes_seen;
|
||||
|
||||
typedef std::list<std::pair<double, const Edge *> > angles_and_edges_list;
|
||||
angles_and_edges_list angles_and_edges;
|
||||
std::vector<angles_and_edges_list::iterator> sorted_edges;
|
||||
while (! concave_vertexes.empty ()) {
|
||||
|
||||
for (auto cc = concave_vertexes.begin (); cc != concave_vertexes.end (); ++cc) {
|
||||
typedef std::list<std::pair<double, const Edge *> > angles_and_edges_list;
|
||||
angles_and_edges_list angles_and_edges;
|
||||
std::vector<angles_and_edges_list::iterator> sorted_edges;
|
||||
|
||||
angles_and_edges.clear ();
|
||||
const Vertex *v0 = cc->corner;
|
||||
std::unordered_set<const Vertex *> new_inner_vertexes;
|
||||
|
||||
const Edge *e = cc->incoming;
|
||||
while (e) {
|
||||
for (auto cc = concave_vertexes.begin (); cc != concave_vertexes.end (); ++cc) {
|
||||
|
||||
const Polygon *t = e->v2 () == v0 ? e->right () : e->left ();
|
||||
tl_assert (t != 0);
|
||||
angles_and_edges.clear ();
|
||||
const Vertex *v0 = cc->corner;
|
||||
|
||||
const Edge *en = t->next_edge (e, v0);
|
||||
tl_assert (en != 0);
|
||||
concave_vertexes_seen.insert (v0);
|
||||
|
||||
db::DVector v1 = e->edge ().d () * (e->v1 () == v0 ? 1.0 : -1.0);
|
||||
db::DVector v2 = en->edge ().d () * (en->v1 () == v0 ? 1.0 : -1.0);
|
||||
const Edge *e = cc->incoming;
|
||||
while (e) {
|
||||
|
||||
double angle = atan2 (db::vprod (v1, v2), db::sprod (v1, v2));
|
||||
const Polygon *t = e->v2 () == v0 ? e->right () : e->left ();
|
||||
tl_assert (t != 0);
|
||||
|
||||
e = (en == cc->outgoing) ? 0 : en;
|
||||
angles_and_edges.push_back (std::make_pair (angle, e));
|
||||
const Edge *en = t->next_edge (e, v0);
|
||||
tl_assert (en != 0);
|
||||
|
||||
db::DVector v1 = e->edge ().d () * (e->v1 () == v0 ? 1.0 : -1.0);
|
||||
db::DVector v2 = en->edge ().d () * (en->v1 () == v0 ? 1.0 : -1.0);
|
||||
|
||||
double angle = atan2 (db::vprod (v1, v2), db::sprod (v1, v2));
|
||||
|
||||
e = (en == cc->outgoing) ? 0 : en;
|
||||
angles_and_edges.push_back (std::make_pair (angle, e));
|
||||
|
||||
}
|
||||
|
||||
sorted_edges.clear ();
|
||||
|
||||
for (auto i = angles_and_edges.begin (); i != angles_and_edges.end (); ++i) {
|
||||
if (i->second) {
|
||||
sorted_edges.push_back (i);
|
||||
}
|
||||
}
|
||||
|
||||
std::sort (sorted_edges.begin (), sorted_edges.end (), SortAngleAndEdgesByEdgeLength ());
|
||||
|
||||
for (auto i = sorted_edges.end (); i != sorted_edges.begin (); ) {
|
||||
--i;
|
||||
angles_and_edges_list::iterator ii = *i;
|
||||
angles_and_edges_list::iterator iin = ii;
|
||||
++iin;
|
||||
if (ii->first + iin->first < (split_edges ? M_PI + db::epsilon : M_PI - db::epsilon)) {
|
||||
// not an essential edge -> remove
|
||||
iin->first += ii->first;
|
||||
angles_and_edges.erase (ii);
|
||||
}
|
||||
}
|
||||
|
||||
for (auto i = angles_and_edges.begin (); i != angles_and_edges.end (); ++i) {
|
||||
if (i->second) {
|
||||
essential_edges.insert (i->second);
|
||||
// record new endpoints of essential edges which are inside the polygon - i.e. they
|
||||
// have a segment attached. Below we will turn them into new concave "corners" and
|
||||
// continue deriving essential edges from there.
|
||||
if (! i->second->v1 ()->is_on_outline () && concave_vertexes_seen.find (i->second->v1 ()) == concave_vertexes_seen.end ()) {
|
||||
new_inner_vertexes.insert (i->second->v1 ());
|
||||
}
|
||||
if (! i->second->v2 ()->is_on_outline () && concave_vertexes_seen.find (i->second->v2 ()) == concave_vertexes_seen.end ()) {
|
||||
new_inner_vertexes.insert (i->second->v2 ());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
sorted_edges.clear ();
|
||||
// new inner vertexes (i.e. endpoints of essential edges inside the polygon) are treated as new convex vertexes
|
||||
|
||||
for (auto i = angles_and_edges.begin (); i != angles_and_edges.end (); ++i) {
|
||||
if (i->second) {
|
||||
sorted_edges.push_back (i);
|
||||
}
|
||||
}
|
||||
concave_vertexes.clear ();
|
||||
|
||||
std::sort (sorted_edges.begin (), sorted_edges.end (), SortAngleAndEdgesByEdgeLength ());
|
||||
for (auto i = new_inner_vertexes.begin (); i != new_inner_vertexes.end (); ++i) {
|
||||
|
||||
for (auto i = sorted_edges.end (); i != sorted_edges.begin (); ) {
|
||||
--i;
|
||||
angles_and_edges_list::iterator ii = *i;
|
||||
angles_and_edges_list::iterator iin = ii;
|
||||
++iin;
|
||||
if (ii->first + iin->first < (split_edges ? M_PI + db::epsilon : M_PI - db::epsilon)) {
|
||||
// not an essential edge -> remove
|
||||
iin->first += ii->first;
|
||||
angles_and_edges.erase (ii);
|
||||
}
|
||||
}
|
||||
const Vertex *v0 = *i;
|
||||
auto ie = v0->begin_edges ();
|
||||
for ( ; ie != v0->end_edges () && essential_edges.find (*ie) == essential_edges.end (); ++ie)
|
||||
;
|
||||
tl_assert (ie != v0->end_edges ());
|
||||
const Edge *e = *ie;
|
||||
|
||||
for (auto i = angles_and_edges.begin (); i != angles_and_edges.end (); ++i) {
|
||||
if (i->second) {
|
||||
essential_edges.insert (i->second);
|
||||
}
|
||||
const Edge *en = e;
|
||||
|
||||
do {
|
||||
|
||||
const Edge *enn = en;
|
||||
|
||||
// look for the next edge (clockwise) which is an essential edge
|
||||
do {
|
||||
const Polygon *t = enn->v2 () == v0 ? enn->right () : enn->left ();
|
||||
tl_assert (t != 0);
|
||||
enn = t->next_edge (enn, v0);
|
||||
tl_assert (enn != 0);
|
||||
} while (enn != en && essential_edges.find (enn) == essential_edges.end ());
|
||||
|
||||
db::DEdge e1 (*en->other (v0), *v0);
|
||||
db::DEdge e2 (*v0, *enn->other (v0));
|
||||
|
||||
// vp > 0: concave, vp < 0: convex
|
||||
int vp_sign = db::vprod_sign (e1, e2);
|
||||
if (vp_sign > 0 || en == enn /*folding back*/) {
|
||||
concave_vertexes.push_back (ConcaveCorner (v0, en, enn));
|
||||
}
|
||||
|
||||
en = enn;
|
||||
|
||||
} while (en != e);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#if defined(DEBUG_DUMP_ESSENTIAL_EDGES)
|
||||
// dump the essential edges for debugging
|
||||
db::Edges edges;
|
||||
for (auto e = essential_edges.begin (); e != essential_edges.end (); ++e) {
|
||||
db::DEdge de = (*e)->edge ();
|
||||
edges.insert (db::VCplxTrans (1000.0) * de);
|
||||
}
|
||||
edges.write ("debug_dump_essential_edges.gds");
|
||||
#endif
|
||||
|
||||
// Combine triangles, but don't cross essential edges
|
||||
|
||||
std::unordered_set<const Polygon *> left_triangles;
|
||||
|
|
|
|||
|
|
@ -136,14 +136,14 @@ private:
|
|||
// .. nothing yet ..
|
||||
}
|
||||
|
||||
ConcaveCorner (Vertex *_corner, Edge *_incoming, Edge *_outgoing)
|
||||
ConcaveCorner (const Vertex *_corner, const Edge *_incoming, const Edge *_outgoing)
|
||||
: corner (_corner), incoming (_incoming), outgoing (_outgoing)
|
||||
{
|
||||
// .. nothing yet ..
|
||||
}
|
||||
|
||||
Vertex *corner;
|
||||
Edge *incoming, *outgoing;
|
||||
const Vertex *corner;
|
||||
const Edge *incoming, *outgoing;
|
||||
};
|
||||
|
||||
void hertel_mehlhorn_decomposition (Triangulation &tris, const ConvexDecompositionParameters ¶m);
|
||||
|
|
|
|||
|
|
@ -275,9 +275,15 @@ SaveLayoutOptions::get_valid_layers (const db::Layout &layout, std::vector <std:
|
|||
|
||||
}
|
||||
|
||||
if (lm == LP_OnlyNumbered) {
|
||||
if (lm == LP_AsIs) {
|
||||
|
||||
for (std::vector<std::pair <unsigned int, db::LayerProperties> >::const_iterator l = all_layers.begin (); l != all_layers.end (); ++l) {
|
||||
for (auto l = all_layers.begin (); l != all_layers.end (); ++l) {
|
||||
layers.push_back (*l);
|
||||
}
|
||||
|
||||
} else if (lm == LP_OnlyNumbered) {
|
||||
|
||||
for (auto l = all_layers.begin (); l != all_layers.end (); ++l) {
|
||||
if (l->second.layer >= 0 && l->second.datatype >= 0) {
|
||||
layers.push_back (*l);
|
||||
}
|
||||
|
|
@ -285,7 +291,7 @@ SaveLayoutOptions::get_valid_layers (const db::Layout &layout, std::vector <std:
|
|||
|
||||
} else if (lm == LP_OnlyNamed) {
|
||||
|
||||
for (std::vector<std::pair <unsigned int, db::LayerProperties> >::const_iterator l = all_layers.begin (); l != all_layers.end (); ++l) {
|
||||
for (auto l = all_layers.begin (); l != all_layers.end (); ++l) {
|
||||
if (! l->second.name.empty ()) {
|
||||
layers.push_back (*l);
|
||||
}
|
||||
|
|
@ -293,7 +299,7 @@ SaveLayoutOptions::get_valid_layers (const db::Layout &layout, std::vector <std:
|
|||
|
||||
} else if (lm == LP_AssignName) {
|
||||
|
||||
for (std::vector<std::pair <unsigned int, db::LayerProperties> >::const_iterator l = all_layers.begin (); l != all_layers.end (); ++l) {
|
||||
for (auto l = all_layers.begin (); l != all_layers.end (); ++l) {
|
||||
layers.push_back (*l);
|
||||
if (l->second.name.empty ()) {
|
||||
layers.back ().second = tl::sprintf ("L%dD%d", l->second.layer, l->second.datatype);
|
||||
|
|
@ -304,7 +310,7 @@ SaveLayoutOptions::get_valid_layers (const db::Layout &layout, std::vector <std:
|
|||
|
||||
} else if (lm == LP_AssignNameWithPriority) {
|
||||
|
||||
for (std::vector<std::pair <unsigned int, db::LayerProperties> >::const_iterator l = all_layers.begin (); l != all_layers.end (); ++l) {
|
||||
for (auto l = all_layers.begin (); l != all_layers.end (); ++l) {
|
||||
layers.push_back (*l);
|
||||
if (l->second.name.empty ()) {
|
||||
layers.back ().second = tl::sprintf ("L%dD%d", l->second.layer, l->second.datatype);
|
||||
|
|
|
|||
|
|
@ -405,7 +405,8 @@ public:
|
|||
LP_OnlyNamed = 1,
|
||||
LP_AssignName = 2,
|
||||
LP_AssignNameWithPriority = 3,
|
||||
LP_AssignNumber = 4
|
||||
LP_AssignNumber = 4,
|
||||
LP_AsIs = 5
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -0,0 +1,6 @@
|
|||
|
||||
[library]
|
||||
name = "_db"
|
||||
defines = [["MAKE_DB_LIBRARY", 1]]
|
||||
depends = ["_tl", "_gsi"]
|
||||
|
||||
|
|
@ -23,6 +23,8 @@
|
|||
|
||||
#include "dbPLCConvexDecomposition.h"
|
||||
#include "dbWriter.h"
|
||||
#include "dbReader.h"
|
||||
#include "dbLayout.h"
|
||||
#include "dbRegionProcessors.h"
|
||||
#include "dbTestSupport.h"
|
||||
#include "tlUnitTest.h"
|
||||
|
|
@ -144,3 +146,80 @@ TEST(problematic_polygon)
|
|||
db::compare_layouts (_this, *ly, tl::testdata () + "/algo/hm_decomposition_au5.gds");
|
||||
}
|
||||
|
||||
TEST(problematic_polygon2)
|
||||
{
|
||||
db::Point contour[] = {
|
||||
db::Point (-2100, 200),
|
||||
db::Point (-2100, 2000),
|
||||
db::Point (-500, 2000),
|
||||
db::Point (-500, 1700),
|
||||
db::Point (-849, 1700),
|
||||
db::Point (-947, 1690),
|
||||
db::Point (-1043, 1671),
|
||||
db::Point (-1137, 1643),
|
||||
db::Point (-1228, 1605),
|
||||
db::Point (-1315, 1559),
|
||||
db::Point (-1396, 1504),
|
||||
db::Point (-1472, 1442),
|
||||
db::Point (-1542, 1372),
|
||||
db::Point (-1604, 1296),
|
||||
db::Point (-1659, 1215),
|
||||
db::Point (-1705, 1128),
|
||||
db::Point (-1743, 1037),
|
||||
db::Point (-1771, 943),
|
||||
db::Point (-1790, 847),
|
||||
db::Point (-1800, 749),
|
||||
db::Point (-1800, 200)
|
||||
};
|
||||
|
||||
db::Polygon poly;
|
||||
poly.assign_hull (contour + 0, contour + sizeof (contour) / sizeof (contour[0]));
|
||||
|
||||
double dbu = 0.001;
|
||||
|
||||
db::plc::ConvexDecompositionParameters param;
|
||||
param.with_segments = false;
|
||||
param.split_edges = false;
|
||||
param.tri_param.max_area = 1000000;
|
||||
param.tri_param.min_b = 0.5;
|
||||
|
||||
db::plc::Graph plc;
|
||||
TestableConvexDecomposition decomp (&plc);
|
||||
|
||||
decomp.decompose (poly, param, dbu);
|
||||
|
||||
std::unique_ptr<db::Layout> ly (plc.to_layout ());
|
||||
db::compare_layouts (_this, *ly, tl::testdata () + "/algo/hm_decomposition_au6.gds");
|
||||
}
|
||||
|
||||
TEST(polygon_with_holes)
|
||||
{
|
||||
db::Layout ly;
|
||||
tl::InputStream s (tl::testdata () + "/algo/hm_decomposition_7.gds");
|
||||
db::Reader reader (s);
|
||||
reader.read (ly);
|
||||
|
||||
unsigned int l1 = ly.get_layer (db::LayerProperties (1, 0));
|
||||
const db::Cell &top = ly.cell (*ly.begin_top_down ());
|
||||
|
||||
db::Region r (db::RecursiveShapeIterator (ly, top, l1));
|
||||
r.merge ();
|
||||
db::Polygon poly = *r.begin ();
|
||||
|
||||
double dbu = 0.001;
|
||||
|
||||
db::plc::ConvexDecompositionParameters param;
|
||||
param.with_segments = false;
|
||||
param.split_edges = false;
|
||||
param.tri_param.max_area = 1000000;
|
||||
param.tri_param.min_b = 0.5;
|
||||
|
||||
db::plc::Graph plc;
|
||||
TestableConvexDecomposition decomp (&plc);
|
||||
|
||||
decomp.decompose (poly, param, dbu);
|
||||
|
||||
std::unique_ptr<db::Layout> ly_out (plc.to_layout ());
|
||||
db::compare_layouts (_this, *ly_out, tl::testdata () + "/algo/hm_decomposition_au7.gds");
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,6 @@
|
|||
|
||||
[library]
|
||||
name = "_edt"
|
||||
defines = [["MAKE_EDT_LIBRARY", 1]]
|
||||
depends = ["_tl", "_gsi", "_db", "_rdb", "_laybasic", "_layview"]
|
||||
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
|
||||
[library]
|
||||
name = "_gsi"
|
||||
defines = [["MAKE_GSI_LIBRARY", 1]]
|
||||
depends = ["_tl"]
|
||||
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
|
||||
[library]
|
||||
name = "_img"
|
||||
defines = [["MAKE_IMG_LIBRARY", 1]]
|
||||
depends = ["_tl", "_gsi", "_db", "_rdb", "_laybasic", "_layview"]
|
||||
|
||||
|
|
@ -613,7 +613,7 @@ private:
|
|||
if (shape->is_polygon ()) {
|
||||
|
||||
for (db::Shape::polygon_edge_iterator e = shape->begin_edge (); ! e.at_end (); ++e) {
|
||||
test_edge (t * *e);
|
||||
test_edge_with_center (t * *e);
|
||||
}
|
||||
|
||||
} else if (shape->is_path ()) {
|
||||
|
|
@ -649,16 +649,20 @@ private:
|
|||
}
|
||||
|
||||
test_edge (db::DEdge (*p, pts [0]));
|
||||
|
||||
}
|
||||
|
||||
} else if (shape->is_box ()) {
|
||||
|
||||
const db::Box &box = shape->box ();
|
||||
|
||||
test_edge (t * db::Edge (box.p1 (), db::Point (box.left (), box.top ())));
|
||||
test_edge (t * db::Edge (db::Point (box.left (), box.top ()), box.p2 ()));
|
||||
test_edge (t * db::Edge (box.p2 (), db::Point (box.right (), box.bottom ())));
|
||||
test_edge (t * db::Edge (db::Point (box.right (), box.bottom ()), box.p1 ()));
|
||||
test_edge_with_center (t * db::Edge (box.p1 (), db::Point (box.left (), box.top ())));
|
||||
test_edge_with_center (t * db::Edge (db::Point (box.left (), box.top ()), box.p2 ()));
|
||||
test_edge_with_center (t * db::Edge (box.p2 (), db::Point (box.right (), box.bottom ())));
|
||||
test_edge_with_center (t * db::Edge (db::Point (box.right (), box.bottom ()), box.p1 ()));
|
||||
|
||||
// test for box center
|
||||
test_edge (t * db::Edge (box.center (), box.center ()));
|
||||
|
||||
} else if (shape->is_point ()) {
|
||||
|
||||
|
|
@ -697,6 +701,22 @@ private:
|
|||
|
||||
}
|
||||
|
||||
void
|
||||
test_edge_with_center (const db::DEdge &edg)
|
||||
{
|
||||
if (m_with_vertex && ! edg.is_degenerate ()) {
|
||||
|
||||
db::DPoint c = edg.p1 () + (edg.p2 () - edg.p1 ()) * 0.5;
|
||||
|
||||
if (m_region.contains (c)) {
|
||||
closest (c);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
test_edge (edg);
|
||||
}
|
||||
|
||||
void
|
||||
test_edge (const db::DEdge &edg)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -0,0 +1,6 @@
|
|||
|
||||
[library]
|
||||
name = "_laybasic"
|
||||
defines = [["MAKE_LAYBASIC_LIBRARY", 1]]
|
||||
depends = ["_tl", "_gsi", "_db", "_rdb"]
|
||||
|
||||
|
|
@ -58,8 +58,12 @@ TEST(1)
|
|||
EXPECT_EQ (res.object_snap, lay::PointSnapToObjectResult::NoObject);
|
||||
EXPECT_EQ (res.snapped_point.to_string (), "1.505,1.505");
|
||||
|
||||
res = lay::obj_snap (&view, db::DPoint (0.505, 0.505), db::DVector (), 0.1);
|
||||
res = lay::obj_snap (&view, db::DPoint (0.805, 0.205), db::DVector (), 0.1);
|
||||
EXPECT_EQ (res.object_snap, lay::PointSnapToObjectResult::ObjectEdge);
|
||||
EXPECT_EQ (res.snapped_point.to_string (), "0.8,0.2");
|
||||
|
||||
res = lay::obj_snap (&view, db::DPoint (0.505, 0.505), db::DVector (), 0.1);
|
||||
EXPECT_EQ (res.object_snap, lay::PointSnapToObjectResult::ObjectUnspecific); // center point of edge
|
||||
EXPECT_EQ (res.snapped_point.to_string (), "0.5,0.5");
|
||||
|
||||
res = lay::obj_snap (&view, db::DPoint (0.485, 0.505), db::DVector (0.01, 0.01), 0.1);
|
||||
|
|
@ -83,9 +87,9 @@ TEST(1)
|
|||
EXPECT_EQ (res.object_snap, lay::PointSnapToObjectResult::ObjectVertex);
|
||||
EXPECT_EQ (res.snapped_point.to_string (), "0,1");
|
||||
|
||||
res = lay::obj_snap (&view, db::DPoint (1.000, 0.505), db::DPoint (0.505, 0.500), db::DVector (), lay::AC_Horizontal, 0.1);
|
||||
res = lay::obj_snap (&view, db::DPoint (1.000, 0.605), db::DPoint (0.405, 0.600), db::DVector (), lay::AC_Horizontal, 0.1);
|
||||
EXPECT_EQ (res.object_snap, lay::PointSnapToObjectResult::ObjectEdge);
|
||||
EXPECT_EQ (res.snapped_point.to_string (), "0.495,0.505");
|
||||
EXPECT_EQ (res.snapped_point.to_string (), "0.395,0.605");
|
||||
|
||||
// projected snapping
|
||||
res = lay::obj_snap (&view, db::DPoint (1.000, 0.505), db::DPoint (0.005, 1.005), db::DVector (), lay::AC_Horizontal, 0.1);
|
||||
|
|
@ -132,21 +136,32 @@ TEST(1)
|
|||
EXPECT_EQ (db::DEdge (res2.first, res2.second).to_string (), "(0.355,0.645;0,0.29)");
|
||||
|
||||
res2 = lay::obj_snap2 (&view, db::DPoint (0.5, 0.5), db::DVector (), 0.005, 1.0);
|
||||
EXPECT_EQ (res2.any, true);
|
||||
EXPECT_EQ (db::DEdge (res2.first, res2.second).to_string (), "(0.5,0.5;0.5,0.5)");
|
||||
|
||||
res2 = lay::obj_snap2 (&view, db::DPoint (0.6, 0.4), db::DVector (), 0.005, 1.0);
|
||||
EXPECT_EQ (res2.any, false);
|
||||
EXPECT_EQ (db::DEdge (res2.first, res2.second).to_string (), "(0,0;0,0)");
|
||||
|
||||
res2 = lay::obj_snap2 (&view, db::DPoint (0.005, 0.5), db::DVector (), 0.005, 1.0);
|
||||
EXPECT_EQ (res2.any, true);
|
||||
EXPECT_EQ (db::DEdge (res2.first, res2.second).to_string (), "(0,0.5;0.5,0.5)");
|
||||
EXPECT_EQ (db::DEdge (res2.first, res2.second).to_string (), "(0,0.5;0,0.5)");
|
||||
|
||||
res2 = lay::obj_snap2 (&view, db::DPoint (0.0, 0.5), db::DVector (), 0.005, 1.0);
|
||||
res2 = lay::obj_snap2 (&view, db::DPoint (0.005, 0.4), db::DVector (), 0.005, 1.0);
|
||||
EXPECT_EQ (res2.any, true);
|
||||
EXPECT_EQ (db::DEdge (res2.first, res2.second).to_string (), "(0,0.4;0.6,0.4)");
|
||||
|
||||
res2 = lay::obj_snap2 (&view, db::DPoint (0.0, 0.4), db::DVector (), 0.005, 1.0);
|
||||
EXPECT_EQ (res2.any, false);
|
||||
EXPECT_EQ (db::DEdge (res2.first, res2.second).to_string (), "(0,0;0,0)");
|
||||
|
||||
res2 = lay::obj_snap2 (&view, db::DPoint (-0.2, 0.5), db::DVector (), 0.005, 1.0);
|
||||
EXPECT_EQ (res2.any, true);
|
||||
EXPECT_EQ (db::DEdge (res2.first, res2.second).to_string (), "(0,0.5;0,0.5)");
|
||||
|
||||
res2 = lay::obj_snap2 (&view, db::DPoint (-0.2, 0.4), db::DVector (), 0.005, 1.0);
|
||||
EXPECT_EQ (res2.any, false);
|
||||
EXPECT_EQ (db::DEdge (res2.first, res2.second).to_string (), "(0,0;0,0)");
|
||||
|
||||
}
|
||||
|
||||
// .. TODO: implement ..
|
||||
|
|
|
|||
|
|
@ -0,0 +1,6 @@
|
|||
|
||||
[library]
|
||||
name = "_layview"
|
||||
defines = [["MAKE_LAYVIEW_LIBRARY", 1]]
|
||||
depends = ["_tl", "_gsi", "_db", "_rdb", "_laybasic"]
|
||||
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
|
||||
[library]
|
||||
name = "_lib"
|
||||
defines = [["MAKE_LIB_LIBRARY", 1]]
|
||||
depends = ["_tl", "_gsi", "_db"]
|
||||
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
|
||||
[library]
|
||||
name = "_lym"
|
||||
defines = [["MAKE_LYM_LIBRARY", 1]]
|
||||
depends = ["_tl", "_gsi", "_rba", "_pya"]
|
||||
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
|
||||
[library]
|
||||
name = "_pex"
|
||||
defines = [["MAKE_PEX_LIBRARY", 1]]
|
||||
depends = ["_tl", "_gsi", "_db"]
|
||||
|
||||
|
|
@ -72,6 +72,14 @@ public:
|
|||
// by the stream and won't trigger a reset of the stream which is not available
|
||||
// on some sources.
|
||||
std::string head = s.read_all (4000);
|
||||
|
||||
// CIF files must not contain null characters
|
||||
for (auto c = head.begin (); c != head.end (); ++c) {
|
||||
if (*c == 0) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
int n = 0;
|
||||
|
||||
tl::Extractor ex (head.c_str ());
|
||||
|
|
|
|||
|
|
@ -0,0 +1,8 @@
|
|||
|
||||
[library]
|
||||
name = "_cif_dbpi"
|
||||
defines = [["MAKE_DB_PLUGIN_LIBRARY", 1]]
|
||||
depends = ["_tl", "_db", "_gsi"]
|
||||
includes = ["/src/plugins/common"]
|
||||
submodules = ["db_plugins"]
|
||||
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
|
||||
[library]
|
||||
name = "_dxf_dbpi"
|
||||
defines = [["MAKE_DB_PLUGIN_LIBRARY", 1]]
|
||||
depends = ["_tl", "_db", "_gsi"]
|
||||
includes = ["/src/plugins/common"]
|
||||
submodules = ["db_plugins"]
|
||||
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
|
||||
[library]
|
||||
name = "_gds2_dbpi"
|
||||
defines = [["MAKE_DB_PLUGIN_LIBRARY", 1]]
|
||||
depends = ["_tl", "_db", "_gsi"]
|
||||
includes = ["/src/plugins/common"]
|
||||
submodules = ["db_plugins"]
|
||||
sources = ["contrib"]
|
||||
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
|
||||
[library]
|
||||
name = "_lefdef_dbpi"
|
||||
defines = [["MAKE_DB_PLUGIN_LIBRARY", 1]]
|
||||
depends = ["_tl", "_db", "_gsi"]
|
||||
includes = ["/src/plugins/common"]
|
||||
submodules = ["db_plugins"]
|
||||
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
|
||||
# LStream plugin sources
|
||||
|
||||
This plugin employs Cap'n'Proto (https://capnproto.org/) to implement
|
||||
the serialization layer.
|
||||
|
||||
The schema files are provided in an already compiled form.
|
||||
The provided sources use Cap'n'Proto compiler version 1.0.1.
|
||||
|
||||
Use the `capnp_compile.sh` script to compile the schema files
|
||||
into C++. It requires "capnp" version 1.0.1.
|
||||
|
||||
The original LStream sources are kept somewhere else.
|
||||
Use `fetch.sh` to sync these external sources with the local
|
||||
ones.
|
||||
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
|
||||
HEADERS=\
|
||||
capnp/cell.capnp.h \
|
||||
capnp/geometry.capnp.h \
|
||||
capnp/header.capnp.h \
|
||||
capnp/layoutView.capnp.h \
|
||||
capnp/library.capnp.h \
|
||||
capnp/metaData.capnp.h \
|
||||
capnp/metaDataView.capnp.h \
|
||||
capnp/propertySet.capnp.h \
|
||||
capnp/repetition.capnp.h \
|
||||
capnp/variant.capnp.h \
|
||||
|
||||
SOURCES=\
|
||||
capnp/cell.capnp.cc \
|
||||
capnp/geometry.capnp.cc \
|
||||
capnp/header.capnp.cc \
|
||||
capnp/layoutView.capnp.cc \
|
||||
capnp/library.capnp.cc \
|
||||
capnp/metaData.capnp.cc \
|
||||
capnp/metaDataView.capnp.cc \
|
||||
capnp/propertySet.capnp.cc \
|
||||
capnp/repetition.capnp.cc \
|
||||
capnp/variant.capnp.cc \
|
||||
|
||||
|
|
@ -0,0 +1,77 @@
|
|||
// Generated by Cap'n Proto compiler, DO NOT EDIT
|
||||
// source: cell.capnp
|
||||
|
||||
#include "cell.capnp.h"
|
||||
|
||||
namespace capnp {
|
||||
namespace schemas {
|
||||
static const ::capnp::_::AlignedData<35> b_f29d05b618de9054 = {
|
||||
{ 0, 0, 0, 0, 5, 0, 6, 0,
|
||||
84, 144, 222, 24, 182, 5, 157, 242,
|
||||
11, 0, 0, 0, 1, 0, 0, 0,
|
||||
239, 93, 77, 24, 100, 238, 216, 191,
|
||||
1, 0, 7, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
21, 0, 0, 0, 130, 0, 0, 0,
|
||||
25, 0, 0, 0, 7, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
21, 0, 0, 0, 63, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
99, 101, 108, 108, 46, 99, 97, 112,
|
||||
110, 112, 58, 67, 101, 108, 108, 0,
|
||||
0, 0, 0, 0, 1, 0, 1, 0,
|
||||
4, 0, 0, 0, 3, 0, 4, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 1, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
13, 0, 0, 0, 66, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
8, 0, 0, 0, 3, 0, 1, 0,
|
||||
36, 0, 0, 0, 2, 0, 1, 0,
|
||||
118, 105, 101, 119, 73, 100, 115, 0,
|
||||
14, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 3, 0, 1, 0,
|
||||
7, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
14, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, }
|
||||
};
|
||||
::capnp::word const* const bp_f29d05b618de9054 = b_f29d05b618de9054.words;
|
||||
#if !CAPNP_LITE
|
||||
static const uint16_t m_f29d05b618de9054[] = {0};
|
||||
static const uint16_t i_f29d05b618de9054[] = {0};
|
||||
const ::capnp::_::RawSchema s_f29d05b618de9054 = {
|
||||
0xf29d05b618de9054, b_f29d05b618de9054.words, 35, nullptr, m_f29d05b618de9054,
|
||||
0, 1, i_f29d05b618de9054, nullptr, nullptr, { &s_f29d05b618de9054, nullptr, nullptr, 0, 0, nullptr }, false
|
||||
};
|
||||
#endif // !CAPNP_LITE
|
||||
} // namespace schemas
|
||||
} // namespace capnp
|
||||
|
||||
// =======================================================================================
|
||||
|
||||
namespace stream {
|
||||
namespace cell {
|
||||
|
||||
// Cell
|
||||
#if CAPNP_NEED_REDUNDANT_CONSTEXPR_DECL
|
||||
constexpr uint16_t Cell::_capnpPrivate::dataWordSize;
|
||||
constexpr uint16_t Cell::_capnpPrivate::pointerCount;
|
||||
#endif // !CAPNP_NEED_REDUNDANT_CONSTEXPR_DECL
|
||||
#if !CAPNP_LITE
|
||||
#if CAPNP_NEED_REDUNDANT_CONSTEXPR_DECL
|
||||
constexpr ::capnp::Kind Cell::_capnpPrivate::kind;
|
||||
constexpr ::capnp::_::RawSchema const* Cell::_capnpPrivate::schema;
|
||||
#endif // !CAPNP_NEED_REDUNDANT_CONSTEXPR_DECL
|
||||
#endif // !CAPNP_LITE
|
||||
|
||||
|
||||
} // namespace
|
||||
} // namespace
|
||||
|
||||
|
|
@ -0,0 +1,172 @@
|
|||
// Generated by Cap'n Proto compiler, DO NOT EDIT
|
||||
// source: cell.capnp
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <capnp/generated-header-support.h>
|
||||
#include <kj/windows-sanity.h>
|
||||
|
||||
#ifndef CAPNP_VERSION
|
||||
#error "CAPNP_VERSION is not defined, is capnp/generated-header-support.h missing?"
|
||||
#elif CAPNP_VERSION != 1000001
|
||||
#error "Version mismatch between generated code and library headers. You must use the same version of the Cap'n Proto compiler and library."
|
||||
#endif
|
||||
|
||||
|
||||
CAPNP_BEGIN_HEADER
|
||||
|
||||
namespace capnp {
|
||||
namespace schemas {
|
||||
|
||||
CAPNP_DECLARE_SCHEMA(f29d05b618de9054);
|
||||
|
||||
} // namespace schemas
|
||||
} // namespace capnp
|
||||
|
||||
namespace stream {
|
||||
namespace cell {
|
||||
|
||||
struct Cell {
|
||||
Cell() = delete;
|
||||
|
||||
class Reader;
|
||||
class Builder;
|
||||
class Pipeline;
|
||||
|
||||
struct _capnpPrivate {
|
||||
CAPNP_DECLARE_STRUCT_HEADER(f29d05b618de9054, 0, 1)
|
||||
#if !CAPNP_LITE
|
||||
static constexpr ::capnp::_::RawBrandedSchema const* brand() { return &schema->defaultBrand; }
|
||||
#endif // !CAPNP_LITE
|
||||
};
|
||||
};
|
||||
|
||||
// =======================================================================================
|
||||
|
||||
class Cell::Reader {
|
||||
public:
|
||||
typedef Cell Reads;
|
||||
|
||||
Reader() = default;
|
||||
inline explicit Reader(::capnp::_::StructReader base): _reader(base) {}
|
||||
|
||||
inline ::capnp::MessageSize totalSize() const {
|
||||
return _reader.totalSize().asPublic();
|
||||
}
|
||||
|
||||
#if !CAPNP_LITE
|
||||
inline ::kj::StringTree toString() const {
|
||||
return ::capnp::_::structString(_reader, *_capnpPrivate::brand());
|
||||
}
|
||||
#endif // !CAPNP_LITE
|
||||
|
||||
inline bool hasViewIds() const;
|
||||
inline ::capnp::List< ::uint16_t, ::capnp::Kind::PRIMITIVE>::Reader getViewIds() const;
|
||||
|
||||
private:
|
||||
::capnp::_::StructReader _reader;
|
||||
template <typename, ::capnp::Kind>
|
||||
friend struct ::capnp::ToDynamic_;
|
||||
template <typename, ::capnp::Kind>
|
||||
friend struct ::capnp::_::PointerHelpers;
|
||||
template <typename, ::capnp::Kind>
|
||||
friend struct ::capnp::List;
|
||||
friend class ::capnp::MessageBuilder;
|
||||
friend class ::capnp::Orphanage;
|
||||
};
|
||||
|
||||
class Cell::Builder {
|
||||
public:
|
||||
typedef Cell Builds;
|
||||
|
||||
Builder() = delete; // Deleted to discourage incorrect usage.
|
||||
// You can explicitly initialize to nullptr instead.
|
||||
inline Builder(decltype(nullptr)) {}
|
||||
inline explicit Builder(::capnp::_::StructBuilder base): _builder(base) {}
|
||||
inline operator Reader() const { return Reader(_builder.asReader()); }
|
||||
inline Reader asReader() const { return *this; }
|
||||
|
||||
inline ::capnp::MessageSize totalSize() const { return asReader().totalSize(); }
|
||||
#if !CAPNP_LITE
|
||||
inline ::kj::StringTree toString() const { return asReader().toString(); }
|
||||
#endif // !CAPNP_LITE
|
||||
|
||||
inline bool hasViewIds();
|
||||
inline ::capnp::List< ::uint16_t, ::capnp::Kind::PRIMITIVE>::Builder getViewIds();
|
||||
inline void setViewIds( ::capnp::List< ::uint16_t, ::capnp::Kind::PRIMITIVE>::Reader value);
|
||||
inline void setViewIds(::kj::ArrayPtr<const ::uint16_t> value);
|
||||
inline ::capnp::List< ::uint16_t, ::capnp::Kind::PRIMITIVE>::Builder initViewIds(unsigned int size);
|
||||
inline void adoptViewIds(::capnp::Orphan< ::capnp::List< ::uint16_t, ::capnp::Kind::PRIMITIVE>>&& value);
|
||||
inline ::capnp::Orphan< ::capnp::List< ::uint16_t, ::capnp::Kind::PRIMITIVE>> disownViewIds();
|
||||
|
||||
private:
|
||||
::capnp::_::StructBuilder _builder;
|
||||
template <typename, ::capnp::Kind>
|
||||
friend struct ::capnp::ToDynamic_;
|
||||
friend class ::capnp::Orphanage;
|
||||
template <typename, ::capnp::Kind>
|
||||
friend struct ::capnp::_::PointerHelpers;
|
||||
};
|
||||
|
||||
#if !CAPNP_LITE
|
||||
class Cell::Pipeline {
|
||||
public:
|
||||
typedef Cell Pipelines;
|
||||
|
||||
inline Pipeline(decltype(nullptr)): _typeless(nullptr) {}
|
||||
inline explicit Pipeline(::capnp::AnyPointer::Pipeline&& typeless)
|
||||
: _typeless(kj::mv(typeless)) {}
|
||||
|
||||
private:
|
||||
::capnp::AnyPointer::Pipeline _typeless;
|
||||
friend class ::capnp::PipelineHook;
|
||||
template <typename, ::capnp::Kind>
|
||||
friend struct ::capnp::ToDynamic_;
|
||||
};
|
||||
#endif // !CAPNP_LITE
|
||||
|
||||
// =======================================================================================
|
||||
|
||||
inline bool Cell::Reader::hasViewIds() const {
|
||||
return !_reader.getPointerField(
|
||||
::capnp::bounded<0>() * ::capnp::POINTERS).isNull();
|
||||
}
|
||||
inline bool Cell::Builder::hasViewIds() {
|
||||
return !_builder.getPointerField(
|
||||
::capnp::bounded<0>() * ::capnp::POINTERS).isNull();
|
||||
}
|
||||
inline ::capnp::List< ::uint16_t, ::capnp::Kind::PRIMITIVE>::Reader Cell::Reader::getViewIds() const {
|
||||
return ::capnp::_::PointerHelpers< ::capnp::List< ::uint16_t, ::capnp::Kind::PRIMITIVE>>::get(_reader.getPointerField(
|
||||
::capnp::bounded<0>() * ::capnp::POINTERS));
|
||||
}
|
||||
inline ::capnp::List< ::uint16_t, ::capnp::Kind::PRIMITIVE>::Builder Cell::Builder::getViewIds() {
|
||||
return ::capnp::_::PointerHelpers< ::capnp::List< ::uint16_t, ::capnp::Kind::PRIMITIVE>>::get(_builder.getPointerField(
|
||||
::capnp::bounded<0>() * ::capnp::POINTERS));
|
||||
}
|
||||
inline void Cell::Builder::setViewIds( ::capnp::List< ::uint16_t, ::capnp::Kind::PRIMITIVE>::Reader value) {
|
||||
::capnp::_::PointerHelpers< ::capnp::List< ::uint16_t, ::capnp::Kind::PRIMITIVE>>::set(_builder.getPointerField(
|
||||
::capnp::bounded<0>() * ::capnp::POINTERS), value);
|
||||
}
|
||||
inline void Cell::Builder::setViewIds(::kj::ArrayPtr<const ::uint16_t> value) {
|
||||
::capnp::_::PointerHelpers< ::capnp::List< ::uint16_t, ::capnp::Kind::PRIMITIVE>>::set(_builder.getPointerField(
|
||||
::capnp::bounded<0>() * ::capnp::POINTERS), value);
|
||||
}
|
||||
inline ::capnp::List< ::uint16_t, ::capnp::Kind::PRIMITIVE>::Builder Cell::Builder::initViewIds(unsigned int size) {
|
||||
return ::capnp::_::PointerHelpers< ::capnp::List< ::uint16_t, ::capnp::Kind::PRIMITIVE>>::init(_builder.getPointerField(
|
||||
::capnp::bounded<0>() * ::capnp::POINTERS), size);
|
||||
}
|
||||
inline void Cell::Builder::adoptViewIds(
|
||||
::capnp::Orphan< ::capnp::List< ::uint16_t, ::capnp::Kind::PRIMITIVE>>&& value) {
|
||||
::capnp::_::PointerHelpers< ::capnp::List< ::uint16_t, ::capnp::Kind::PRIMITIVE>>::adopt(_builder.getPointerField(
|
||||
::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value));
|
||||
}
|
||||
inline ::capnp::Orphan< ::capnp::List< ::uint16_t, ::capnp::Kind::PRIMITIVE>> Cell::Builder::disownViewIds() {
|
||||
return ::capnp::_::PointerHelpers< ::capnp::List< ::uint16_t, ::capnp::Kind::PRIMITIVE>>::disown(_builder.getPointerField(
|
||||
::capnp::bounded<0>() * ::capnp::POINTERS));
|
||||
}
|
||||
|
||||
} // namespace
|
||||
} // namespace
|
||||
|
||||
CAPNP_END_HEADER
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
|
@ -0,0 +1,202 @@
|
|||
// Generated by Cap'n Proto compiler, DO NOT EDIT
|
||||
// source: header.capnp
|
||||
|
||||
#include "header.capnp.h"
|
||||
|
||||
namespace capnp {
|
||||
namespace schemas {
|
||||
static const ::capnp::_::AlignedData<48> b_ca6137cc23ea16e8 = {
|
||||
{ 0, 0, 0, 0, 5, 0, 6, 0,
|
||||
232, 22, 234, 35, 204, 55, 97, 202,
|
||||
13, 0, 0, 0, 1, 0, 0, 0,
|
||||
36, 255, 84, 206, 94, 231, 245, 197,
|
||||
2, 0, 7, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
21, 0, 0, 0, 202, 0, 0, 0,
|
||||
33, 0, 0, 0, 7, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
29, 0, 0, 0, 119, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
104, 101, 97, 100, 101, 114, 46, 99,
|
||||
97, 112, 110, 112, 58, 76, 105, 98,
|
||||
114, 97, 114, 121, 83, 112, 101, 99,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 1, 0, 1, 0,
|
||||
8, 0, 0, 0, 3, 0, 4, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 1, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
41, 0, 0, 0, 42, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
36, 0, 0, 0, 3, 0, 1, 0,
|
||||
48, 0, 0, 0, 2, 0, 1, 0,
|
||||
1, 0, 0, 0, 1, 0, 0, 0,
|
||||
0, 0, 1, 0, 1, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
45, 0, 0, 0, 42, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
40, 0, 0, 0, 3, 0, 1, 0,
|
||||
52, 0, 0, 0, 2, 0, 1, 0,
|
||||
110, 97, 109, 101, 0, 0, 0, 0,
|
||||
12, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
12, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
116, 121, 112, 101, 0, 0, 0, 0,
|
||||
12, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
12, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, }
|
||||
};
|
||||
::capnp::word const* const bp_ca6137cc23ea16e8 = b_ca6137cc23ea16e8.words;
|
||||
#if !CAPNP_LITE
|
||||
static const uint16_t m_ca6137cc23ea16e8[] = {0, 1};
|
||||
static const uint16_t i_ca6137cc23ea16e8[] = {0, 1};
|
||||
const ::capnp::_::RawSchema s_ca6137cc23ea16e8 = {
|
||||
0xca6137cc23ea16e8, b_ca6137cc23ea16e8.words, 48, nullptr, m_ca6137cc23ea16e8,
|
||||
0, 2, i_ca6137cc23ea16e8, nullptr, nullptr, { &s_ca6137cc23ea16e8, nullptr, nullptr, 0, 0, nullptr }, false
|
||||
};
|
||||
#endif // !CAPNP_LITE
|
||||
static const ::capnp::_::AlignedData<85> b_a72897b14bf79c6b = {
|
||||
{ 0, 0, 0, 0, 5, 0, 6, 0,
|
||||
107, 156, 247, 75, 177, 151, 40, 167,
|
||||
13, 0, 0, 0, 1, 0, 0, 0,
|
||||
36, 255, 84, 206, 94, 231, 245, 197,
|
||||
4, 0, 7, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
21, 0, 0, 0, 162, 0, 0, 0,
|
||||
29, 0, 0, 0, 7, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
25, 0, 0, 0, 231, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
104, 101, 97, 100, 101, 114, 46, 99,
|
||||
97, 112, 110, 112, 58, 72, 101, 97,
|
||||
100, 101, 114, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 1, 0, 1, 0,
|
||||
16, 0, 0, 0, 3, 0, 4, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 1, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
97, 0, 0, 0, 74, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
96, 0, 0, 0, 3, 0, 1, 0,
|
||||
108, 0, 0, 0, 2, 0, 1, 0,
|
||||
1, 0, 0, 0, 1, 0, 0, 0,
|
||||
0, 0, 1, 0, 1, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
105, 0, 0, 0, 82, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
104, 0, 0, 0, 3, 0, 1, 0,
|
||||
116, 0, 0, 0, 2, 0, 1, 0,
|
||||
2, 0, 0, 0, 2, 0, 0, 0,
|
||||
0, 0, 1, 0, 2, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
113, 0, 0, 0, 90, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
112, 0, 0, 0, 3, 0, 1, 0,
|
||||
124, 0, 0, 0, 2, 0, 1, 0,
|
||||
3, 0, 0, 0, 3, 0, 0, 0,
|
||||
0, 0, 1, 0, 3, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
121, 0, 0, 0, 82, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
120, 0, 0, 0, 3, 0, 1, 0,
|
||||
148, 0, 0, 0, 2, 0, 1, 0,
|
||||
109, 101, 116, 97, 68, 97, 116, 97,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
16, 0, 0, 0, 0, 0, 0, 0,
|
||||
56, 212, 213, 232, 233, 209, 66, 147,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
16, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
103, 101, 110, 101, 114, 97, 116, 111,
|
||||
114, 0, 0, 0, 0, 0, 0, 0,
|
||||
12, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
12, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
116, 101, 99, 104, 110, 111, 108, 111,
|
||||
103, 121, 0, 0, 0, 0, 0, 0,
|
||||
12, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
12, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
108, 105, 98, 114, 97, 114, 105, 101,
|
||||
115, 0, 0, 0, 0, 0, 0, 0,
|
||||
14, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 3, 0, 1, 0,
|
||||
16, 0, 0, 0, 0, 0, 0, 0,
|
||||
232, 22, 234, 35, 204, 55, 97, 202,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
14, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, }
|
||||
};
|
||||
::capnp::word const* const bp_a72897b14bf79c6b = b_a72897b14bf79c6b.words;
|
||||
#if !CAPNP_LITE
|
||||
static const ::capnp::_::RawSchema* const d_a72897b14bf79c6b[] = {
|
||||
&s_9342d1e9e8d5d438,
|
||||
&s_ca6137cc23ea16e8,
|
||||
};
|
||||
static const uint16_t m_a72897b14bf79c6b[] = {1, 3, 0, 2};
|
||||
static const uint16_t i_a72897b14bf79c6b[] = {0, 1, 2, 3};
|
||||
const ::capnp::_::RawSchema s_a72897b14bf79c6b = {
|
||||
0xa72897b14bf79c6b, b_a72897b14bf79c6b.words, 85, d_a72897b14bf79c6b, m_a72897b14bf79c6b,
|
||||
2, 4, i_a72897b14bf79c6b, nullptr, nullptr, { &s_a72897b14bf79c6b, nullptr, nullptr, 0, 0, nullptr }, false
|
||||
};
|
||||
#endif // !CAPNP_LITE
|
||||
} // namespace schemas
|
||||
} // namespace capnp
|
||||
|
||||
// =======================================================================================
|
||||
|
||||
namespace stream {
|
||||
namespace header {
|
||||
|
||||
// LibrarySpec
|
||||
#if CAPNP_NEED_REDUNDANT_CONSTEXPR_DECL
|
||||
constexpr uint16_t LibrarySpec::_capnpPrivate::dataWordSize;
|
||||
constexpr uint16_t LibrarySpec::_capnpPrivate::pointerCount;
|
||||
#endif // !CAPNP_NEED_REDUNDANT_CONSTEXPR_DECL
|
||||
#if !CAPNP_LITE
|
||||
#if CAPNP_NEED_REDUNDANT_CONSTEXPR_DECL
|
||||
constexpr ::capnp::Kind LibrarySpec::_capnpPrivate::kind;
|
||||
constexpr ::capnp::_::RawSchema const* LibrarySpec::_capnpPrivate::schema;
|
||||
#endif // !CAPNP_NEED_REDUNDANT_CONSTEXPR_DECL
|
||||
#endif // !CAPNP_LITE
|
||||
|
||||
// Header
|
||||
#if CAPNP_NEED_REDUNDANT_CONSTEXPR_DECL
|
||||
constexpr uint16_t Header::_capnpPrivate::dataWordSize;
|
||||
constexpr uint16_t Header::_capnpPrivate::pointerCount;
|
||||
#endif // !CAPNP_NEED_REDUNDANT_CONSTEXPR_DECL
|
||||
#if !CAPNP_LITE
|
||||
#if CAPNP_NEED_REDUNDANT_CONSTEXPR_DECL
|
||||
constexpr ::capnp::Kind Header::_capnpPrivate::kind;
|
||||
constexpr ::capnp::_::RawSchema const* Header::_capnpPrivate::schema;
|
||||
#endif // !CAPNP_NEED_REDUNDANT_CONSTEXPR_DECL
|
||||
#endif // !CAPNP_LITE
|
||||
|
||||
|
||||
} // namespace
|
||||
} // namespace
|
||||
|
||||
|
|
@ -0,0 +1,481 @@
|
|||
// Generated by Cap'n Proto compiler, DO NOT EDIT
|
||||
// source: header.capnp
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <capnp/generated-header-support.h>
|
||||
#include <kj/windows-sanity.h>
|
||||
|
||||
#ifndef CAPNP_VERSION
|
||||
#error "CAPNP_VERSION is not defined, is capnp/generated-header-support.h missing?"
|
||||
#elif CAPNP_VERSION != 1000001
|
||||
#error "Version mismatch between generated code and library headers. You must use the same version of the Cap'n Proto compiler and library."
|
||||
#endif
|
||||
|
||||
#include "metaData.capnp.h"
|
||||
|
||||
CAPNP_BEGIN_HEADER
|
||||
|
||||
namespace capnp {
|
||||
namespace schemas {
|
||||
|
||||
CAPNP_DECLARE_SCHEMA(ca6137cc23ea16e8);
|
||||
CAPNP_DECLARE_SCHEMA(a72897b14bf79c6b);
|
||||
|
||||
} // namespace schemas
|
||||
} // namespace capnp
|
||||
|
||||
namespace stream {
|
||||
namespace header {
|
||||
|
||||
struct LibrarySpec {
|
||||
LibrarySpec() = delete;
|
||||
|
||||
class Reader;
|
||||
class Builder;
|
||||
class Pipeline;
|
||||
|
||||
struct _capnpPrivate {
|
||||
CAPNP_DECLARE_STRUCT_HEADER(ca6137cc23ea16e8, 0, 2)
|
||||
#if !CAPNP_LITE
|
||||
static constexpr ::capnp::_::RawBrandedSchema const* brand() { return &schema->defaultBrand; }
|
||||
#endif // !CAPNP_LITE
|
||||
};
|
||||
};
|
||||
|
||||
struct Header {
|
||||
Header() = delete;
|
||||
|
||||
class Reader;
|
||||
class Builder;
|
||||
class Pipeline;
|
||||
|
||||
struct _capnpPrivate {
|
||||
CAPNP_DECLARE_STRUCT_HEADER(a72897b14bf79c6b, 0, 4)
|
||||
#if !CAPNP_LITE
|
||||
static constexpr ::capnp::_::RawBrandedSchema const* brand() { return &schema->defaultBrand; }
|
||||
#endif // !CAPNP_LITE
|
||||
};
|
||||
};
|
||||
|
||||
// =======================================================================================
|
||||
|
||||
class LibrarySpec::Reader {
|
||||
public:
|
||||
typedef LibrarySpec Reads;
|
||||
|
||||
Reader() = default;
|
||||
inline explicit Reader(::capnp::_::StructReader base): _reader(base) {}
|
||||
|
||||
inline ::capnp::MessageSize totalSize() const {
|
||||
return _reader.totalSize().asPublic();
|
||||
}
|
||||
|
||||
#if !CAPNP_LITE
|
||||
inline ::kj::StringTree toString() const {
|
||||
return ::capnp::_::structString(_reader, *_capnpPrivate::brand());
|
||||
}
|
||||
#endif // !CAPNP_LITE
|
||||
|
||||
inline bool hasName() const;
|
||||
inline ::capnp::Text::Reader getName() const;
|
||||
|
||||
inline bool hasType() const;
|
||||
inline ::capnp::Text::Reader getType() const;
|
||||
|
||||
private:
|
||||
::capnp::_::StructReader _reader;
|
||||
template <typename, ::capnp::Kind>
|
||||
friend struct ::capnp::ToDynamic_;
|
||||
template <typename, ::capnp::Kind>
|
||||
friend struct ::capnp::_::PointerHelpers;
|
||||
template <typename, ::capnp::Kind>
|
||||
friend struct ::capnp::List;
|
||||
friend class ::capnp::MessageBuilder;
|
||||
friend class ::capnp::Orphanage;
|
||||
};
|
||||
|
||||
class LibrarySpec::Builder {
|
||||
public:
|
||||
typedef LibrarySpec Builds;
|
||||
|
||||
Builder() = delete; // Deleted to discourage incorrect usage.
|
||||
// You can explicitly initialize to nullptr instead.
|
||||
inline Builder(decltype(nullptr)) {}
|
||||
inline explicit Builder(::capnp::_::StructBuilder base): _builder(base) {}
|
||||
inline operator Reader() const { return Reader(_builder.asReader()); }
|
||||
inline Reader asReader() const { return *this; }
|
||||
|
||||
inline ::capnp::MessageSize totalSize() const { return asReader().totalSize(); }
|
||||
#if !CAPNP_LITE
|
||||
inline ::kj::StringTree toString() const { return asReader().toString(); }
|
||||
#endif // !CAPNP_LITE
|
||||
|
||||
inline bool hasName();
|
||||
inline ::capnp::Text::Builder getName();
|
||||
inline void setName( ::capnp::Text::Reader value);
|
||||
inline ::capnp::Text::Builder initName(unsigned int size);
|
||||
inline void adoptName(::capnp::Orphan< ::capnp::Text>&& value);
|
||||
inline ::capnp::Orphan< ::capnp::Text> disownName();
|
||||
|
||||
inline bool hasType();
|
||||
inline ::capnp::Text::Builder getType();
|
||||
inline void setType( ::capnp::Text::Reader value);
|
||||
inline ::capnp::Text::Builder initType(unsigned int size);
|
||||
inline void adoptType(::capnp::Orphan< ::capnp::Text>&& value);
|
||||
inline ::capnp::Orphan< ::capnp::Text> disownType();
|
||||
|
||||
private:
|
||||
::capnp::_::StructBuilder _builder;
|
||||
template <typename, ::capnp::Kind>
|
||||
friend struct ::capnp::ToDynamic_;
|
||||
friend class ::capnp::Orphanage;
|
||||
template <typename, ::capnp::Kind>
|
||||
friend struct ::capnp::_::PointerHelpers;
|
||||
};
|
||||
|
||||
#if !CAPNP_LITE
|
||||
class LibrarySpec::Pipeline {
|
||||
public:
|
||||
typedef LibrarySpec Pipelines;
|
||||
|
||||
inline Pipeline(decltype(nullptr)): _typeless(nullptr) {}
|
||||
inline explicit Pipeline(::capnp::AnyPointer::Pipeline&& typeless)
|
||||
: _typeless(kj::mv(typeless)) {}
|
||||
|
||||
private:
|
||||
::capnp::AnyPointer::Pipeline _typeless;
|
||||
friend class ::capnp::PipelineHook;
|
||||
template <typename, ::capnp::Kind>
|
||||
friend struct ::capnp::ToDynamic_;
|
||||
};
|
||||
#endif // !CAPNP_LITE
|
||||
|
||||
class Header::Reader {
|
||||
public:
|
||||
typedef Header Reads;
|
||||
|
||||
Reader() = default;
|
||||
inline explicit Reader(::capnp::_::StructReader base): _reader(base) {}
|
||||
|
||||
inline ::capnp::MessageSize totalSize() const {
|
||||
return _reader.totalSize().asPublic();
|
||||
}
|
||||
|
||||
#if !CAPNP_LITE
|
||||
inline ::kj::StringTree toString() const {
|
||||
return ::capnp::_::structString(_reader, *_capnpPrivate::brand());
|
||||
}
|
||||
#endif // !CAPNP_LITE
|
||||
|
||||
inline bool hasMetaData() const;
|
||||
inline ::stream::metaData::MetaData::Reader getMetaData() const;
|
||||
|
||||
inline bool hasGenerator() const;
|
||||
inline ::capnp::Text::Reader getGenerator() const;
|
||||
|
||||
inline bool hasTechnology() const;
|
||||
inline ::capnp::Text::Reader getTechnology() const;
|
||||
|
||||
inline bool hasLibraries() const;
|
||||
inline ::capnp::List< ::stream::header::LibrarySpec, ::capnp::Kind::STRUCT>::Reader getLibraries() const;
|
||||
|
||||
private:
|
||||
::capnp::_::StructReader _reader;
|
||||
template <typename, ::capnp::Kind>
|
||||
friend struct ::capnp::ToDynamic_;
|
||||
template <typename, ::capnp::Kind>
|
||||
friend struct ::capnp::_::PointerHelpers;
|
||||
template <typename, ::capnp::Kind>
|
||||
friend struct ::capnp::List;
|
||||
friend class ::capnp::MessageBuilder;
|
||||
friend class ::capnp::Orphanage;
|
||||
};
|
||||
|
||||
class Header::Builder {
|
||||
public:
|
||||
typedef Header Builds;
|
||||
|
||||
Builder() = delete; // Deleted to discourage incorrect usage.
|
||||
// You can explicitly initialize to nullptr instead.
|
||||
inline Builder(decltype(nullptr)) {}
|
||||
inline explicit Builder(::capnp::_::StructBuilder base): _builder(base) {}
|
||||
inline operator Reader() const { return Reader(_builder.asReader()); }
|
||||
inline Reader asReader() const { return *this; }
|
||||
|
||||
inline ::capnp::MessageSize totalSize() const { return asReader().totalSize(); }
|
||||
#if !CAPNP_LITE
|
||||
inline ::kj::StringTree toString() const { return asReader().toString(); }
|
||||
#endif // !CAPNP_LITE
|
||||
|
||||
inline bool hasMetaData();
|
||||
inline ::stream::metaData::MetaData::Builder getMetaData();
|
||||
inline void setMetaData( ::stream::metaData::MetaData::Reader value);
|
||||
inline ::stream::metaData::MetaData::Builder initMetaData();
|
||||
inline void adoptMetaData(::capnp::Orphan< ::stream::metaData::MetaData>&& value);
|
||||
inline ::capnp::Orphan< ::stream::metaData::MetaData> disownMetaData();
|
||||
|
||||
inline bool hasGenerator();
|
||||
inline ::capnp::Text::Builder getGenerator();
|
||||
inline void setGenerator( ::capnp::Text::Reader value);
|
||||
inline ::capnp::Text::Builder initGenerator(unsigned int size);
|
||||
inline void adoptGenerator(::capnp::Orphan< ::capnp::Text>&& value);
|
||||
inline ::capnp::Orphan< ::capnp::Text> disownGenerator();
|
||||
|
||||
inline bool hasTechnology();
|
||||
inline ::capnp::Text::Builder getTechnology();
|
||||
inline void setTechnology( ::capnp::Text::Reader value);
|
||||
inline ::capnp::Text::Builder initTechnology(unsigned int size);
|
||||
inline void adoptTechnology(::capnp::Orphan< ::capnp::Text>&& value);
|
||||
inline ::capnp::Orphan< ::capnp::Text> disownTechnology();
|
||||
|
||||
inline bool hasLibraries();
|
||||
inline ::capnp::List< ::stream::header::LibrarySpec, ::capnp::Kind::STRUCT>::Builder getLibraries();
|
||||
inline void setLibraries( ::capnp::List< ::stream::header::LibrarySpec, ::capnp::Kind::STRUCT>::Reader value);
|
||||
inline ::capnp::List< ::stream::header::LibrarySpec, ::capnp::Kind::STRUCT>::Builder initLibraries(unsigned int size);
|
||||
inline void adoptLibraries(::capnp::Orphan< ::capnp::List< ::stream::header::LibrarySpec, ::capnp::Kind::STRUCT>>&& value);
|
||||
inline ::capnp::Orphan< ::capnp::List< ::stream::header::LibrarySpec, ::capnp::Kind::STRUCT>> disownLibraries();
|
||||
|
||||
private:
|
||||
::capnp::_::StructBuilder _builder;
|
||||
template <typename, ::capnp::Kind>
|
||||
friend struct ::capnp::ToDynamic_;
|
||||
friend class ::capnp::Orphanage;
|
||||
template <typename, ::capnp::Kind>
|
||||
friend struct ::capnp::_::PointerHelpers;
|
||||
};
|
||||
|
||||
#if !CAPNP_LITE
|
||||
class Header::Pipeline {
|
||||
public:
|
||||
typedef Header Pipelines;
|
||||
|
||||
inline Pipeline(decltype(nullptr)): _typeless(nullptr) {}
|
||||
inline explicit Pipeline(::capnp::AnyPointer::Pipeline&& typeless)
|
||||
: _typeless(kj::mv(typeless)) {}
|
||||
|
||||
inline ::stream::metaData::MetaData::Pipeline getMetaData();
|
||||
private:
|
||||
::capnp::AnyPointer::Pipeline _typeless;
|
||||
friend class ::capnp::PipelineHook;
|
||||
template <typename, ::capnp::Kind>
|
||||
friend struct ::capnp::ToDynamic_;
|
||||
};
|
||||
#endif // !CAPNP_LITE
|
||||
|
||||
// =======================================================================================
|
||||
|
||||
inline bool LibrarySpec::Reader::hasName() const {
|
||||
return !_reader.getPointerField(
|
||||
::capnp::bounded<0>() * ::capnp::POINTERS).isNull();
|
||||
}
|
||||
inline bool LibrarySpec::Builder::hasName() {
|
||||
return !_builder.getPointerField(
|
||||
::capnp::bounded<0>() * ::capnp::POINTERS).isNull();
|
||||
}
|
||||
inline ::capnp::Text::Reader LibrarySpec::Reader::getName() const {
|
||||
return ::capnp::_::PointerHelpers< ::capnp::Text>::get(_reader.getPointerField(
|
||||
::capnp::bounded<0>() * ::capnp::POINTERS));
|
||||
}
|
||||
inline ::capnp::Text::Builder LibrarySpec::Builder::getName() {
|
||||
return ::capnp::_::PointerHelpers< ::capnp::Text>::get(_builder.getPointerField(
|
||||
::capnp::bounded<0>() * ::capnp::POINTERS));
|
||||
}
|
||||
inline void LibrarySpec::Builder::setName( ::capnp::Text::Reader value) {
|
||||
::capnp::_::PointerHelpers< ::capnp::Text>::set(_builder.getPointerField(
|
||||
::capnp::bounded<0>() * ::capnp::POINTERS), value);
|
||||
}
|
||||
inline ::capnp::Text::Builder LibrarySpec::Builder::initName(unsigned int size) {
|
||||
return ::capnp::_::PointerHelpers< ::capnp::Text>::init(_builder.getPointerField(
|
||||
::capnp::bounded<0>() * ::capnp::POINTERS), size);
|
||||
}
|
||||
inline void LibrarySpec::Builder::adoptName(
|
||||
::capnp::Orphan< ::capnp::Text>&& value) {
|
||||
::capnp::_::PointerHelpers< ::capnp::Text>::adopt(_builder.getPointerField(
|
||||
::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value));
|
||||
}
|
||||
inline ::capnp::Orphan< ::capnp::Text> LibrarySpec::Builder::disownName() {
|
||||
return ::capnp::_::PointerHelpers< ::capnp::Text>::disown(_builder.getPointerField(
|
||||
::capnp::bounded<0>() * ::capnp::POINTERS));
|
||||
}
|
||||
|
||||
inline bool LibrarySpec::Reader::hasType() const {
|
||||
return !_reader.getPointerField(
|
||||
::capnp::bounded<1>() * ::capnp::POINTERS).isNull();
|
||||
}
|
||||
inline bool LibrarySpec::Builder::hasType() {
|
||||
return !_builder.getPointerField(
|
||||
::capnp::bounded<1>() * ::capnp::POINTERS).isNull();
|
||||
}
|
||||
inline ::capnp::Text::Reader LibrarySpec::Reader::getType() const {
|
||||
return ::capnp::_::PointerHelpers< ::capnp::Text>::get(_reader.getPointerField(
|
||||
::capnp::bounded<1>() * ::capnp::POINTERS));
|
||||
}
|
||||
inline ::capnp::Text::Builder LibrarySpec::Builder::getType() {
|
||||
return ::capnp::_::PointerHelpers< ::capnp::Text>::get(_builder.getPointerField(
|
||||
::capnp::bounded<1>() * ::capnp::POINTERS));
|
||||
}
|
||||
inline void LibrarySpec::Builder::setType( ::capnp::Text::Reader value) {
|
||||
::capnp::_::PointerHelpers< ::capnp::Text>::set(_builder.getPointerField(
|
||||
::capnp::bounded<1>() * ::capnp::POINTERS), value);
|
||||
}
|
||||
inline ::capnp::Text::Builder LibrarySpec::Builder::initType(unsigned int size) {
|
||||
return ::capnp::_::PointerHelpers< ::capnp::Text>::init(_builder.getPointerField(
|
||||
::capnp::bounded<1>() * ::capnp::POINTERS), size);
|
||||
}
|
||||
inline void LibrarySpec::Builder::adoptType(
|
||||
::capnp::Orphan< ::capnp::Text>&& value) {
|
||||
::capnp::_::PointerHelpers< ::capnp::Text>::adopt(_builder.getPointerField(
|
||||
::capnp::bounded<1>() * ::capnp::POINTERS), kj::mv(value));
|
||||
}
|
||||
inline ::capnp::Orphan< ::capnp::Text> LibrarySpec::Builder::disownType() {
|
||||
return ::capnp::_::PointerHelpers< ::capnp::Text>::disown(_builder.getPointerField(
|
||||
::capnp::bounded<1>() * ::capnp::POINTERS));
|
||||
}
|
||||
|
||||
inline bool Header::Reader::hasMetaData() const {
|
||||
return !_reader.getPointerField(
|
||||
::capnp::bounded<0>() * ::capnp::POINTERS).isNull();
|
||||
}
|
||||
inline bool Header::Builder::hasMetaData() {
|
||||
return !_builder.getPointerField(
|
||||
::capnp::bounded<0>() * ::capnp::POINTERS).isNull();
|
||||
}
|
||||
inline ::stream::metaData::MetaData::Reader Header::Reader::getMetaData() const {
|
||||
return ::capnp::_::PointerHelpers< ::stream::metaData::MetaData>::get(_reader.getPointerField(
|
||||
::capnp::bounded<0>() * ::capnp::POINTERS));
|
||||
}
|
||||
inline ::stream::metaData::MetaData::Builder Header::Builder::getMetaData() {
|
||||
return ::capnp::_::PointerHelpers< ::stream::metaData::MetaData>::get(_builder.getPointerField(
|
||||
::capnp::bounded<0>() * ::capnp::POINTERS));
|
||||
}
|
||||
#if !CAPNP_LITE
|
||||
inline ::stream::metaData::MetaData::Pipeline Header::Pipeline::getMetaData() {
|
||||
return ::stream::metaData::MetaData::Pipeline(_typeless.getPointerField(0));
|
||||
}
|
||||
#endif // !CAPNP_LITE
|
||||
inline void Header::Builder::setMetaData( ::stream::metaData::MetaData::Reader value) {
|
||||
::capnp::_::PointerHelpers< ::stream::metaData::MetaData>::set(_builder.getPointerField(
|
||||
::capnp::bounded<0>() * ::capnp::POINTERS), value);
|
||||
}
|
||||
inline ::stream::metaData::MetaData::Builder Header::Builder::initMetaData() {
|
||||
return ::capnp::_::PointerHelpers< ::stream::metaData::MetaData>::init(_builder.getPointerField(
|
||||
::capnp::bounded<0>() * ::capnp::POINTERS));
|
||||
}
|
||||
inline void Header::Builder::adoptMetaData(
|
||||
::capnp::Orphan< ::stream::metaData::MetaData>&& value) {
|
||||
::capnp::_::PointerHelpers< ::stream::metaData::MetaData>::adopt(_builder.getPointerField(
|
||||
::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value));
|
||||
}
|
||||
inline ::capnp::Orphan< ::stream::metaData::MetaData> Header::Builder::disownMetaData() {
|
||||
return ::capnp::_::PointerHelpers< ::stream::metaData::MetaData>::disown(_builder.getPointerField(
|
||||
::capnp::bounded<0>() * ::capnp::POINTERS));
|
||||
}
|
||||
|
||||
inline bool Header::Reader::hasGenerator() const {
|
||||
return !_reader.getPointerField(
|
||||
::capnp::bounded<1>() * ::capnp::POINTERS).isNull();
|
||||
}
|
||||
inline bool Header::Builder::hasGenerator() {
|
||||
return !_builder.getPointerField(
|
||||
::capnp::bounded<1>() * ::capnp::POINTERS).isNull();
|
||||
}
|
||||
inline ::capnp::Text::Reader Header::Reader::getGenerator() const {
|
||||
return ::capnp::_::PointerHelpers< ::capnp::Text>::get(_reader.getPointerField(
|
||||
::capnp::bounded<1>() * ::capnp::POINTERS));
|
||||
}
|
||||
inline ::capnp::Text::Builder Header::Builder::getGenerator() {
|
||||
return ::capnp::_::PointerHelpers< ::capnp::Text>::get(_builder.getPointerField(
|
||||
::capnp::bounded<1>() * ::capnp::POINTERS));
|
||||
}
|
||||
inline void Header::Builder::setGenerator( ::capnp::Text::Reader value) {
|
||||
::capnp::_::PointerHelpers< ::capnp::Text>::set(_builder.getPointerField(
|
||||
::capnp::bounded<1>() * ::capnp::POINTERS), value);
|
||||
}
|
||||
inline ::capnp::Text::Builder Header::Builder::initGenerator(unsigned int size) {
|
||||
return ::capnp::_::PointerHelpers< ::capnp::Text>::init(_builder.getPointerField(
|
||||
::capnp::bounded<1>() * ::capnp::POINTERS), size);
|
||||
}
|
||||
inline void Header::Builder::adoptGenerator(
|
||||
::capnp::Orphan< ::capnp::Text>&& value) {
|
||||
::capnp::_::PointerHelpers< ::capnp::Text>::adopt(_builder.getPointerField(
|
||||
::capnp::bounded<1>() * ::capnp::POINTERS), kj::mv(value));
|
||||
}
|
||||
inline ::capnp::Orphan< ::capnp::Text> Header::Builder::disownGenerator() {
|
||||
return ::capnp::_::PointerHelpers< ::capnp::Text>::disown(_builder.getPointerField(
|
||||
::capnp::bounded<1>() * ::capnp::POINTERS));
|
||||
}
|
||||
|
||||
inline bool Header::Reader::hasTechnology() const {
|
||||
return !_reader.getPointerField(
|
||||
::capnp::bounded<2>() * ::capnp::POINTERS).isNull();
|
||||
}
|
||||
inline bool Header::Builder::hasTechnology() {
|
||||
return !_builder.getPointerField(
|
||||
::capnp::bounded<2>() * ::capnp::POINTERS).isNull();
|
||||
}
|
||||
inline ::capnp::Text::Reader Header::Reader::getTechnology() const {
|
||||
return ::capnp::_::PointerHelpers< ::capnp::Text>::get(_reader.getPointerField(
|
||||
::capnp::bounded<2>() * ::capnp::POINTERS));
|
||||
}
|
||||
inline ::capnp::Text::Builder Header::Builder::getTechnology() {
|
||||
return ::capnp::_::PointerHelpers< ::capnp::Text>::get(_builder.getPointerField(
|
||||
::capnp::bounded<2>() * ::capnp::POINTERS));
|
||||
}
|
||||
inline void Header::Builder::setTechnology( ::capnp::Text::Reader value) {
|
||||
::capnp::_::PointerHelpers< ::capnp::Text>::set(_builder.getPointerField(
|
||||
::capnp::bounded<2>() * ::capnp::POINTERS), value);
|
||||
}
|
||||
inline ::capnp::Text::Builder Header::Builder::initTechnology(unsigned int size) {
|
||||
return ::capnp::_::PointerHelpers< ::capnp::Text>::init(_builder.getPointerField(
|
||||
::capnp::bounded<2>() * ::capnp::POINTERS), size);
|
||||
}
|
||||
inline void Header::Builder::adoptTechnology(
|
||||
::capnp::Orphan< ::capnp::Text>&& value) {
|
||||
::capnp::_::PointerHelpers< ::capnp::Text>::adopt(_builder.getPointerField(
|
||||
::capnp::bounded<2>() * ::capnp::POINTERS), kj::mv(value));
|
||||
}
|
||||
inline ::capnp::Orphan< ::capnp::Text> Header::Builder::disownTechnology() {
|
||||
return ::capnp::_::PointerHelpers< ::capnp::Text>::disown(_builder.getPointerField(
|
||||
::capnp::bounded<2>() * ::capnp::POINTERS));
|
||||
}
|
||||
|
||||
inline bool Header::Reader::hasLibraries() const {
|
||||
return !_reader.getPointerField(
|
||||
::capnp::bounded<3>() * ::capnp::POINTERS).isNull();
|
||||
}
|
||||
inline bool Header::Builder::hasLibraries() {
|
||||
return !_builder.getPointerField(
|
||||
::capnp::bounded<3>() * ::capnp::POINTERS).isNull();
|
||||
}
|
||||
inline ::capnp::List< ::stream::header::LibrarySpec, ::capnp::Kind::STRUCT>::Reader Header::Reader::getLibraries() const {
|
||||
return ::capnp::_::PointerHelpers< ::capnp::List< ::stream::header::LibrarySpec, ::capnp::Kind::STRUCT>>::get(_reader.getPointerField(
|
||||
::capnp::bounded<3>() * ::capnp::POINTERS));
|
||||
}
|
||||
inline ::capnp::List< ::stream::header::LibrarySpec, ::capnp::Kind::STRUCT>::Builder Header::Builder::getLibraries() {
|
||||
return ::capnp::_::PointerHelpers< ::capnp::List< ::stream::header::LibrarySpec, ::capnp::Kind::STRUCT>>::get(_builder.getPointerField(
|
||||
::capnp::bounded<3>() * ::capnp::POINTERS));
|
||||
}
|
||||
inline void Header::Builder::setLibraries( ::capnp::List< ::stream::header::LibrarySpec, ::capnp::Kind::STRUCT>::Reader value) {
|
||||
::capnp::_::PointerHelpers< ::capnp::List< ::stream::header::LibrarySpec, ::capnp::Kind::STRUCT>>::set(_builder.getPointerField(
|
||||
::capnp::bounded<3>() * ::capnp::POINTERS), value);
|
||||
}
|
||||
inline ::capnp::List< ::stream::header::LibrarySpec, ::capnp::Kind::STRUCT>::Builder Header::Builder::initLibraries(unsigned int size) {
|
||||
return ::capnp::_::PointerHelpers< ::capnp::List< ::stream::header::LibrarySpec, ::capnp::Kind::STRUCT>>::init(_builder.getPointerField(
|
||||
::capnp::bounded<3>() * ::capnp::POINTERS), size);
|
||||
}
|
||||
inline void Header::Builder::adoptLibraries(
|
||||
::capnp::Orphan< ::capnp::List< ::stream::header::LibrarySpec, ::capnp::Kind::STRUCT>>&& value) {
|
||||
::capnp::_::PointerHelpers< ::capnp::List< ::stream::header::LibrarySpec, ::capnp::Kind::STRUCT>>::adopt(_builder.getPointerField(
|
||||
::capnp::bounded<3>() * ::capnp::POINTERS), kj::mv(value));
|
||||
}
|
||||
inline ::capnp::Orphan< ::capnp::List< ::stream::header::LibrarySpec, ::capnp::Kind::STRUCT>> Header::Builder::disownLibraries() {
|
||||
return ::capnp::_::PointerHelpers< ::capnp::List< ::stream::header::LibrarySpec, ::capnp::Kind::STRUCT>>::disown(_builder.getPointerField(
|
||||
::capnp::bounded<3>() * ::capnp::POINTERS));
|
||||
}
|
||||
|
||||
} // namespace
|
||||
} // namespace
|
||||
|
||||
CAPNP_END_HEADER
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
|
@ -0,0 +1,171 @@
|
|||
// Generated by Cap'n Proto compiler, DO NOT EDIT
|
||||
// source: metaData.capnp
|
||||
|
||||
#include "metaData.capnp.h"
|
||||
|
||||
namespace capnp {
|
||||
namespace schemas {
|
||||
static const ::capnp::_::AlignedData<64> b_cf35f955a29422a3 = {
|
||||
{ 0, 0, 0, 0, 5, 0, 6, 0,
|
||||
163, 34, 148, 162, 85, 249, 53, 207,
|
||||
15, 0, 0, 0, 1, 0, 0, 0,
|
||||
162, 141, 82, 244, 3, 18, 213, 145,
|
||||
3, 0, 7, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
21, 0, 0, 0, 234, 0, 0, 0,
|
||||
33, 0, 0, 0, 7, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
29, 0, 0, 0, 175, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
109, 101, 116, 97, 68, 97, 116, 97,
|
||||
46, 99, 97, 112, 110, 112, 58, 77,
|
||||
101, 116, 97, 68, 97, 116, 97, 69,
|
||||
110, 116, 114, 121, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 1, 0, 1, 0,
|
||||
12, 0, 0, 0, 3, 0, 4, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 1, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
69, 0, 0, 0, 42, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
64, 0, 0, 0, 3, 0, 1, 0,
|
||||
76, 0, 0, 0, 2, 0, 1, 0,
|
||||
1, 0, 0, 0, 1, 0, 0, 0,
|
||||
0, 0, 1, 0, 1, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
73, 0, 0, 0, 98, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
72, 0, 0, 0, 3, 0, 1, 0,
|
||||
84, 0, 0, 0, 2, 0, 1, 0,
|
||||
2, 0, 0, 0, 2, 0, 0, 0,
|
||||
0, 0, 1, 0, 2, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
81, 0, 0, 0, 50, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
76, 0, 0, 0, 3, 0, 1, 0,
|
||||
88, 0, 0, 0, 2, 0, 1, 0,
|
||||
110, 97, 109, 101, 0, 0, 0, 0,
|
||||
12, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
12, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
100, 101, 115, 99, 114, 105, 112, 116,
|
||||
105, 111, 110, 0, 0, 0, 0, 0,
|
||||
12, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
12, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
118, 97, 108, 117, 101, 0, 0, 0,
|
||||
16, 0, 0, 0, 0, 0, 0, 0,
|
||||
198, 25, 189, 174, 235, 112, 106, 249,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
16, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, }
|
||||
};
|
||||
::capnp::word const* const bp_cf35f955a29422a3 = b_cf35f955a29422a3.words;
|
||||
#if !CAPNP_LITE
|
||||
static const ::capnp::_::RawSchema* const d_cf35f955a29422a3[] = {
|
||||
&s_f96a70ebaebd19c6,
|
||||
};
|
||||
static const uint16_t m_cf35f955a29422a3[] = {1, 0, 2};
|
||||
static const uint16_t i_cf35f955a29422a3[] = {0, 1, 2};
|
||||
const ::capnp::_::RawSchema s_cf35f955a29422a3 = {
|
||||
0xcf35f955a29422a3, b_cf35f955a29422a3.words, 64, d_cf35f955a29422a3, m_cf35f955a29422a3,
|
||||
1, 3, i_cf35f955a29422a3, nullptr, nullptr, { &s_cf35f955a29422a3, nullptr, nullptr, 0, 0, nullptr }, false
|
||||
};
|
||||
#endif // !CAPNP_LITE
|
||||
static const ::capnp::_::AlignedData<36> b_9342d1e9e8d5d438 = {
|
||||
{ 0, 0, 0, 0, 5, 0, 6, 0,
|
||||
56, 212, 213, 232, 233, 209, 66, 147,
|
||||
15, 0, 0, 0, 1, 0, 0, 0,
|
||||
162, 141, 82, 244, 3, 18, 213, 145,
|
||||
1, 0, 7, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
21, 0, 0, 0, 194, 0, 0, 0,
|
||||
29, 0, 0, 0, 7, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
25, 0, 0, 0, 63, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
109, 101, 116, 97, 68, 97, 116, 97,
|
||||
46, 99, 97, 112, 110, 112, 58, 77,
|
||||
101, 116, 97, 68, 97, 116, 97, 0,
|
||||
0, 0, 0, 0, 1, 0, 1, 0,
|
||||
4, 0, 0, 0, 3, 0, 4, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 1, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
13, 0, 0, 0, 66, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
8, 0, 0, 0, 3, 0, 1, 0,
|
||||
36, 0, 0, 0, 2, 0, 1, 0,
|
||||
101, 110, 116, 114, 105, 101, 115, 0,
|
||||
14, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 3, 0, 1, 0,
|
||||
16, 0, 0, 0, 0, 0, 0, 0,
|
||||
163, 34, 148, 162, 85, 249, 53, 207,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
14, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, }
|
||||
};
|
||||
::capnp::word const* const bp_9342d1e9e8d5d438 = b_9342d1e9e8d5d438.words;
|
||||
#if !CAPNP_LITE
|
||||
static const ::capnp::_::RawSchema* const d_9342d1e9e8d5d438[] = {
|
||||
&s_cf35f955a29422a3,
|
||||
};
|
||||
static const uint16_t m_9342d1e9e8d5d438[] = {0};
|
||||
static const uint16_t i_9342d1e9e8d5d438[] = {0};
|
||||
const ::capnp::_::RawSchema s_9342d1e9e8d5d438 = {
|
||||
0x9342d1e9e8d5d438, b_9342d1e9e8d5d438.words, 36, d_9342d1e9e8d5d438, m_9342d1e9e8d5d438,
|
||||
1, 1, i_9342d1e9e8d5d438, nullptr, nullptr, { &s_9342d1e9e8d5d438, nullptr, nullptr, 0, 0, nullptr }, false
|
||||
};
|
||||
#endif // !CAPNP_LITE
|
||||
} // namespace schemas
|
||||
} // namespace capnp
|
||||
|
||||
// =======================================================================================
|
||||
|
||||
namespace stream {
|
||||
namespace metaData {
|
||||
|
||||
// MetaDataEntry
|
||||
#if CAPNP_NEED_REDUNDANT_CONSTEXPR_DECL
|
||||
constexpr uint16_t MetaDataEntry::_capnpPrivate::dataWordSize;
|
||||
constexpr uint16_t MetaDataEntry::_capnpPrivate::pointerCount;
|
||||
#endif // !CAPNP_NEED_REDUNDANT_CONSTEXPR_DECL
|
||||
#if !CAPNP_LITE
|
||||
#if CAPNP_NEED_REDUNDANT_CONSTEXPR_DECL
|
||||
constexpr ::capnp::Kind MetaDataEntry::_capnpPrivate::kind;
|
||||
constexpr ::capnp::_::RawSchema const* MetaDataEntry::_capnpPrivate::schema;
|
||||
#endif // !CAPNP_NEED_REDUNDANT_CONSTEXPR_DECL
|
||||
#endif // !CAPNP_LITE
|
||||
|
||||
// MetaData
|
||||
#if CAPNP_NEED_REDUNDANT_CONSTEXPR_DECL
|
||||
constexpr uint16_t MetaData::_capnpPrivate::dataWordSize;
|
||||
constexpr uint16_t MetaData::_capnpPrivate::pointerCount;
|
||||
#endif // !CAPNP_NEED_REDUNDANT_CONSTEXPR_DECL
|
||||
#if !CAPNP_LITE
|
||||
#if CAPNP_NEED_REDUNDANT_CONSTEXPR_DECL
|
||||
constexpr ::capnp::Kind MetaData::_capnpPrivate::kind;
|
||||
constexpr ::capnp::_::RawSchema const* MetaData::_capnpPrivate::schema;
|
||||
#endif // !CAPNP_NEED_REDUNDANT_CONSTEXPR_DECL
|
||||
#endif // !CAPNP_LITE
|
||||
|
||||
|
||||
} // namespace
|
||||
} // namespace
|
||||
|
||||
|
|
@ -0,0 +1,393 @@
|
|||
// Generated by Cap'n Proto compiler, DO NOT EDIT
|
||||
// source: metaData.capnp
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <capnp/generated-header-support.h>
|
||||
#include <kj/windows-sanity.h>
|
||||
|
||||
#ifndef CAPNP_VERSION
|
||||
#error "CAPNP_VERSION is not defined, is capnp/generated-header-support.h missing?"
|
||||
#elif CAPNP_VERSION != 1000001
|
||||
#error "Version mismatch between generated code and library headers. You must use the same version of the Cap'n Proto compiler and library."
|
||||
#endif
|
||||
|
||||
#include "variant.capnp.h"
|
||||
|
||||
CAPNP_BEGIN_HEADER
|
||||
|
||||
namespace capnp {
|
||||
namespace schemas {
|
||||
|
||||
CAPNP_DECLARE_SCHEMA(cf35f955a29422a3);
|
||||
CAPNP_DECLARE_SCHEMA(9342d1e9e8d5d438);
|
||||
|
||||
} // namespace schemas
|
||||
} // namespace capnp
|
||||
|
||||
namespace stream {
|
||||
namespace metaData {
|
||||
|
||||
struct MetaDataEntry {
|
||||
MetaDataEntry() = delete;
|
||||
|
||||
class Reader;
|
||||
class Builder;
|
||||
class Pipeline;
|
||||
|
||||
struct _capnpPrivate {
|
||||
CAPNP_DECLARE_STRUCT_HEADER(cf35f955a29422a3, 0, 3)
|
||||
#if !CAPNP_LITE
|
||||
static constexpr ::capnp::_::RawBrandedSchema const* brand() { return &schema->defaultBrand; }
|
||||
#endif // !CAPNP_LITE
|
||||
};
|
||||
};
|
||||
|
||||
struct MetaData {
|
||||
MetaData() = delete;
|
||||
|
||||
class Reader;
|
||||
class Builder;
|
||||
class Pipeline;
|
||||
|
||||
struct _capnpPrivate {
|
||||
CAPNP_DECLARE_STRUCT_HEADER(9342d1e9e8d5d438, 0, 1)
|
||||
#if !CAPNP_LITE
|
||||
static constexpr ::capnp::_::RawBrandedSchema const* brand() { return &schema->defaultBrand; }
|
||||
#endif // !CAPNP_LITE
|
||||
};
|
||||
};
|
||||
|
||||
// =======================================================================================
|
||||
|
||||
class MetaDataEntry::Reader {
|
||||
public:
|
||||
typedef MetaDataEntry Reads;
|
||||
|
||||
Reader() = default;
|
||||
inline explicit Reader(::capnp::_::StructReader base): _reader(base) {}
|
||||
|
||||
inline ::capnp::MessageSize totalSize() const {
|
||||
return _reader.totalSize().asPublic();
|
||||
}
|
||||
|
||||
#if !CAPNP_LITE
|
||||
inline ::kj::StringTree toString() const {
|
||||
return ::capnp::_::structString(_reader, *_capnpPrivate::brand());
|
||||
}
|
||||
#endif // !CAPNP_LITE
|
||||
|
||||
inline bool hasName() const;
|
||||
inline ::capnp::Text::Reader getName() const;
|
||||
|
||||
inline bool hasDescription() const;
|
||||
inline ::capnp::Text::Reader getDescription() const;
|
||||
|
||||
inline bool hasValue() const;
|
||||
inline ::stream::variant::Variant::Reader getValue() const;
|
||||
|
||||
private:
|
||||
::capnp::_::StructReader _reader;
|
||||
template <typename, ::capnp::Kind>
|
||||
friend struct ::capnp::ToDynamic_;
|
||||
template <typename, ::capnp::Kind>
|
||||
friend struct ::capnp::_::PointerHelpers;
|
||||
template <typename, ::capnp::Kind>
|
||||
friend struct ::capnp::List;
|
||||
friend class ::capnp::MessageBuilder;
|
||||
friend class ::capnp::Orphanage;
|
||||
};
|
||||
|
||||
class MetaDataEntry::Builder {
|
||||
public:
|
||||
typedef MetaDataEntry Builds;
|
||||
|
||||
Builder() = delete; // Deleted to discourage incorrect usage.
|
||||
// You can explicitly initialize to nullptr instead.
|
||||
inline Builder(decltype(nullptr)) {}
|
||||
inline explicit Builder(::capnp::_::StructBuilder base): _builder(base) {}
|
||||
inline operator Reader() const { return Reader(_builder.asReader()); }
|
||||
inline Reader asReader() const { return *this; }
|
||||
|
||||
inline ::capnp::MessageSize totalSize() const { return asReader().totalSize(); }
|
||||
#if !CAPNP_LITE
|
||||
inline ::kj::StringTree toString() const { return asReader().toString(); }
|
||||
#endif // !CAPNP_LITE
|
||||
|
||||
inline bool hasName();
|
||||
inline ::capnp::Text::Builder getName();
|
||||
inline void setName( ::capnp::Text::Reader value);
|
||||
inline ::capnp::Text::Builder initName(unsigned int size);
|
||||
inline void adoptName(::capnp::Orphan< ::capnp::Text>&& value);
|
||||
inline ::capnp::Orphan< ::capnp::Text> disownName();
|
||||
|
||||
inline bool hasDescription();
|
||||
inline ::capnp::Text::Builder getDescription();
|
||||
inline void setDescription( ::capnp::Text::Reader value);
|
||||
inline ::capnp::Text::Builder initDescription(unsigned int size);
|
||||
inline void adoptDescription(::capnp::Orphan< ::capnp::Text>&& value);
|
||||
inline ::capnp::Orphan< ::capnp::Text> disownDescription();
|
||||
|
||||
inline bool hasValue();
|
||||
inline ::stream::variant::Variant::Builder getValue();
|
||||
inline void setValue( ::stream::variant::Variant::Reader value);
|
||||
inline ::stream::variant::Variant::Builder initValue();
|
||||
inline void adoptValue(::capnp::Orphan< ::stream::variant::Variant>&& value);
|
||||
inline ::capnp::Orphan< ::stream::variant::Variant> disownValue();
|
||||
|
||||
private:
|
||||
::capnp::_::StructBuilder _builder;
|
||||
template <typename, ::capnp::Kind>
|
||||
friend struct ::capnp::ToDynamic_;
|
||||
friend class ::capnp::Orphanage;
|
||||
template <typename, ::capnp::Kind>
|
||||
friend struct ::capnp::_::PointerHelpers;
|
||||
};
|
||||
|
||||
#if !CAPNP_LITE
|
||||
class MetaDataEntry::Pipeline {
|
||||
public:
|
||||
typedef MetaDataEntry Pipelines;
|
||||
|
||||
inline Pipeline(decltype(nullptr)): _typeless(nullptr) {}
|
||||
inline explicit Pipeline(::capnp::AnyPointer::Pipeline&& typeless)
|
||||
: _typeless(kj::mv(typeless)) {}
|
||||
|
||||
inline ::stream::variant::Variant::Pipeline getValue();
|
||||
private:
|
||||
::capnp::AnyPointer::Pipeline _typeless;
|
||||
friend class ::capnp::PipelineHook;
|
||||
template <typename, ::capnp::Kind>
|
||||
friend struct ::capnp::ToDynamic_;
|
||||
};
|
||||
#endif // !CAPNP_LITE
|
||||
|
||||
class MetaData::Reader {
|
||||
public:
|
||||
typedef MetaData Reads;
|
||||
|
||||
Reader() = default;
|
||||
inline explicit Reader(::capnp::_::StructReader base): _reader(base) {}
|
||||
|
||||
inline ::capnp::MessageSize totalSize() const {
|
||||
return _reader.totalSize().asPublic();
|
||||
}
|
||||
|
||||
#if !CAPNP_LITE
|
||||
inline ::kj::StringTree toString() const {
|
||||
return ::capnp::_::structString(_reader, *_capnpPrivate::brand());
|
||||
}
|
||||
#endif // !CAPNP_LITE
|
||||
|
||||
inline bool hasEntries() const;
|
||||
inline ::capnp::List< ::stream::metaData::MetaDataEntry, ::capnp::Kind::STRUCT>::Reader getEntries() const;
|
||||
|
||||
private:
|
||||
::capnp::_::StructReader _reader;
|
||||
template <typename, ::capnp::Kind>
|
||||
friend struct ::capnp::ToDynamic_;
|
||||
template <typename, ::capnp::Kind>
|
||||
friend struct ::capnp::_::PointerHelpers;
|
||||
template <typename, ::capnp::Kind>
|
||||
friend struct ::capnp::List;
|
||||
friend class ::capnp::MessageBuilder;
|
||||
friend class ::capnp::Orphanage;
|
||||
};
|
||||
|
||||
class MetaData::Builder {
|
||||
public:
|
||||
typedef MetaData Builds;
|
||||
|
||||
Builder() = delete; // Deleted to discourage incorrect usage.
|
||||
// You can explicitly initialize to nullptr instead.
|
||||
inline Builder(decltype(nullptr)) {}
|
||||
inline explicit Builder(::capnp::_::StructBuilder base): _builder(base) {}
|
||||
inline operator Reader() const { return Reader(_builder.asReader()); }
|
||||
inline Reader asReader() const { return *this; }
|
||||
|
||||
inline ::capnp::MessageSize totalSize() const { return asReader().totalSize(); }
|
||||
#if !CAPNP_LITE
|
||||
inline ::kj::StringTree toString() const { return asReader().toString(); }
|
||||
#endif // !CAPNP_LITE
|
||||
|
||||
inline bool hasEntries();
|
||||
inline ::capnp::List< ::stream::metaData::MetaDataEntry, ::capnp::Kind::STRUCT>::Builder getEntries();
|
||||
inline void setEntries( ::capnp::List< ::stream::metaData::MetaDataEntry, ::capnp::Kind::STRUCT>::Reader value);
|
||||
inline ::capnp::List< ::stream::metaData::MetaDataEntry, ::capnp::Kind::STRUCT>::Builder initEntries(unsigned int size);
|
||||
inline void adoptEntries(::capnp::Orphan< ::capnp::List< ::stream::metaData::MetaDataEntry, ::capnp::Kind::STRUCT>>&& value);
|
||||
inline ::capnp::Orphan< ::capnp::List< ::stream::metaData::MetaDataEntry, ::capnp::Kind::STRUCT>> disownEntries();
|
||||
|
||||
private:
|
||||
::capnp::_::StructBuilder _builder;
|
||||
template <typename, ::capnp::Kind>
|
||||
friend struct ::capnp::ToDynamic_;
|
||||
friend class ::capnp::Orphanage;
|
||||
template <typename, ::capnp::Kind>
|
||||
friend struct ::capnp::_::PointerHelpers;
|
||||
};
|
||||
|
||||
#if !CAPNP_LITE
|
||||
class MetaData::Pipeline {
|
||||
public:
|
||||
typedef MetaData Pipelines;
|
||||
|
||||
inline Pipeline(decltype(nullptr)): _typeless(nullptr) {}
|
||||
inline explicit Pipeline(::capnp::AnyPointer::Pipeline&& typeless)
|
||||
: _typeless(kj::mv(typeless)) {}
|
||||
|
||||
private:
|
||||
::capnp::AnyPointer::Pipeline _typeless;
|
||||
friend class ::capnp::PipelineHook;
|
||||
template <typename, ::capnp::Kind>
|
||||
friend struct ::capnp::ToDynamic_;
|
||||
};
|
||||
#endif // !CAPNP_LITE
|
||||
|
||||
// =======================================================================================
|
||||
|
||||
inline bool MetaDataEntry::Reader::hasName() const {
|
||||
return !_reader.getPointerField(
|
||||
::capnp::bounded<0>() * ::capnp::POINTERS).isNull();
|
||||
}
|
||||
inline bool MetaDataEntry::Builder::hasName() {
|
||||
return !_builder.getPointerField(
|
||||
::capnp::bounded<0>() * ::capnp::POINTERS).isNull();
|
||||
}
|
||||
inline ::capnp::Text::Reader MetaDataEntry::Reader::getName() const {
|
||||
return ::capnp::_::PointerHelpers< ::capnp::Text>::get(_reader.getPointerField(
|
||||
::capnp::bounded<0>() * ::capnp::POINTERS));
|
||||
}
|
||||
inline ::capnp::Text::Builder MetaDataEntry::Builder::getName() {
|
||||
return ::capnp::_::PointerHelpers< ::capnp::Text>::get(_builder.getPointerField(
|
||||
::capnp::bounded<0>() * ::capnp::POINTERS));
|
||||
}
|
||||
inline void MetaDataEntry::Builder::setName( ::capnp::Text::Reader value) {
|
||||
::capnp::_::PointerHelpers< ::capnp::Text>::set(_builder.getPointerField(
|
||||
::capnp::bounded<0>() * ::capnp::POINTERS), value);
|
||||
}
|
||||
inline ::capnp::Text::Builder MetaDataEntry::Builder::initName(unsigned int size) {
|
||||
return ::capnp::_::PointerHelpers< ::capnp::Text>::init(_builder.getPointerField(
|
||||
::capnp::bounded<0>() * ::capnp::POINTERS), size);
|
||||
}
|
||||
inline void MetaDataEntry::Builder::adoptName(
|
||||
::capnp::Orphan< ::capnp::Text>&& value) {
|
||||
::capnp::_::PointerHelpers< ::capnp::Text>::adopt(_builder.getPointerField(
|
||||
::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value));
|
||||
}
|
||||
inline ::capnp::Orphan< ::capnp::Text> MetaDataEntry::Builder::disownName() {
|
||||
return ::capnp::_::PointerHelpers< ::capnp::Text>::disown(_builder.getPointerField(
|
||||
::capnp::bounded<0>() * ::capnp::POINTERS));
|
||||
}
|
||||
|
||||
inline bool MetaDataEntry::Reader::hasDescription() const {
|
||||
return !_reader.getPointerField(
|
||||
::capnp::bounded<1>() * ::capnp::POINTERS).isNull();
|
||||
}
|
||||
inline bool MetaDataEntry::Builder::hasDescription() {
|
||||
return !_builder.getPointerField(
|
||||
::capnp::bounded<1>() * ::capnp::POINTERS).isNull();
|
||||
}
|
||||
inline ::capnp::Text::Reader MetaDataEntry::Reader::getDescription() const {
|
||||
return ::capnp::_::PointerHelpers< ::capnp::Text>::get(_reader.getPointerField(
|
||||
::capnp::bounded<1>() * ::capnp::POINTERS));
|
||||
}
|
||||
inline ::capnp::Text::Builder MetaDataEntry::Builder::getDescription() {
|
||||
return ::capnp::_::PointerHelpers< ::capnp::Text>::get(_builder.getPointerField(
|
||||
::capnp::bounded<1>() * ::capnp::POINTERS));
|
||||
}
|
||||
inline void MetaDataEntry::Builder::setDescription( ::capnp::Text::Reader value) {
|
||||
::capnp::_::PointerHelpers< ::capnp::Text>::set(_builder.getPointerField(
|
||||
::capnp::bounded<1>() * ::capnp::POINTERS), value);
|
||||
}
|
||||
inline ::capnp::Text::Builder MetaDataEntry::Builder::initDescription(unsigned int size) {
|
||||
return ::capnp::_::PointerHelpers< ::capnp::Text>::init(_builder.getPointerField(
|
||||
::capnp::bounded<1>() * ::capnp::POINTERS), size);
|
||||
}
|
||||
inline void MetaDataEntry::Builder::adoptDescription(
|
||||
::capnp::Orphan< ::capnp::Text>&& value) {
|
||||
::capnp::_::PointerHelpers< ::capnp::Text>::adopt(_builder.getPointerField(
|
||||
::capnp::bounded<1>() * ::capnp::POINTERS), kj::mv(value));
|
||||
}
|
||||
inline ::capnp::Orphan< ::capnp::Text> MetaDataEntry::Builder::disownDescription() {
|
||||
return ::capnp::_::PointerHelpers< ::capnp::Text>::disown(_builder.getPointerField(
|
||||
::capnp::bounded<1>() * ::capnp::POINTERS));
|
||||
}
|
||||
|
||||
inline bool MetaDataEntry::Reader::hasValue() const {
|
||||
return !_reader.getPointerField(
|
||||
::capnp::bounded<2>() * ::capnp::POINTERS).isNull();
|
||||
}
|
||||
inline bool MetaDataEntry::Builder::hasValue() {
|
||||
return !_builder.getPointerField(
|
||||
::capnp::bounded<2>() * ::capnp::POINTERS).isNull();
|
||||
}
|
||||
inline ::stream::variant::Variant::Reader MetaDataEntry::Reader::getValue() const {
|
||||
return ::capnp::_::PointerHelpers< ::stream::variant::Variant>::get(_reader.getPointerField(
|
||||
::capnp::bounded<2>() * ::capnp::POINTERS));
|
||||
}
|
||||
inline ::stream::variant::Variant::Builder MetaDataEntry::Builder::getValue() {
|
||||
return ::capnp::_::PointerHelpers< ::stream::variant::Variant>::get(_builder.getPointerField(
|
||||
::capnp::bounded<2>() * ::capnp::POINTERS));
|
||||
}
|
||||
#if !CAPNP_LITE
|
||||
inline ::stream::variant::Variant::Pipeline MetaDataEntry::Pipeline::getValue() {
|
||||
return ::stream::variant::Variant::Pipeline(_typeless.getPointerField(2));
|
||||
}
|
||||
#endif // !CAPNP_LITE
|
||||
inline void MetaDataEntry::Builder::setValue( ::stream::variant::Variant::Reader value) {
|
||||
::capnp::_::PointerHelpers< ::stream::variant::Variant>::set(_builder.getPointerField(
|
||||
::capnp::bounded<2>() * ::capnp::POINTERS), value);
|
||||
}
|
||||
inline ::stream::variant::Variant::Builder MetaDataEntry::Builder::initValue() {
|
||||
return ::capnp::_::PointerHelpers< ::stream::variant::Variant>::init(_builder.getPointerField(
|
||||
::capnp::bounded<2>() * ::capnp::POINTERS));
|
||||
}
|
||||
inline void MetaDataEntry::Builder::adoptValue(
|
||||
::capnp::Orphan< ::stream::variant::Variant>&& value) {
|
||||
::capnp::_::PointerHelpers< ::stream::variant::Variant>::adopt(_builder.getPointerField(
|
||||
::capnp::bounded<2>() * ::capnp::POINTERS), kj::mv(value));
|
||||
}
|
||||
inline ::capnp::Orphan< ::stream::variant::Variant> MetaDataEntry::Builder::disownValue() {
|
||||
return ::capnp::_::PointerHelpers< ::stream::variant::Variant>::disown(_builder.getPointerField(
|
||||
::capnp::bounded<2>() * ::capnp::POINTERS));
|
||||
}
|
||||
|
||||
inline bool MetaData::Reader::hasEntries() const {
|
||||
return !_reader.getPointerField(
|
||||
::capnp::bounded<0>() * ::capnp::POINTERS).isNull();
|
||||
}
|
||||
inline bool MetaData::Builder::hasEntries() {
|
||||
return !_builder.getPointerField(
|
||||
::capnp::bounded<0>() * ::capnp::POINTERS).isNull();
|
||||
}
|
||||
inline ::capnp::List< ::stream::metaData::MetaDataEntry, ::capnp::Kind::STRUCT>::Reader MetaData::Reader::getEntries() const {
|
||||
return ::capnp::_::PointerHelpers< ::capnp::List< ::stream::metaData::MetaDataEntry, ::capnp::Kind::STRUCT>>::get(_reader.getPointerField(
|
||||
::capnp::bounded<0>() * ::capnp::POINTERS));
|
||||
}
|
||||
inline ::capnp::List< ::stream::metaData::MetaDataEntry, ::capnp::Kind::STRUCT>::Builder MetaData::Builder::getEntries() {
|
||||
return ::capnp::_::PointerHelpers< ::capnp::List< ::stream::metaData::MetaDataEntry, ::capnp::Kind::STRUCT>>::get(_builder.getPointerField(
|
||||
::capnp::bounded<0>() * ::capnp::POINTERS));
|
||||
}
|
||||
inline void MetaData::Builder::setEntries( ::capnp::List< ::stream::metaData::MetaDataEntry, ::capnp::Kind::STRUCT>::Reader value) {
|
||||
::capnp::_::PointerHelpers< ::capnp::List< ::stream::metaData::MetaDataEntry, ::capnp::Kind::STRUCT>>::set(_builder.getPointerField(
|
||||
::capnp::bounded<0>() * ::capnp::POINTERS), value);
|
||||
}
|
||||
inline ::capnp::List< ::stream::metaData::MetaDataEntry, ::capnp::Kind::STRUCT>::Builder MetaData::Builder::initEntries(unsigned int size) {
|
||||
return ::capnp::_::PointerHelpers< ::capnp::List< ::stream::metaData::MetaDataEntry, ::capnp::Kind::STRUCT>>::init(_builder.getPointerField(
|
||||
::capnp::bounded<0>() * ::capnp::POINTERS), size);
|
||||
}
|
||||
inline void MetaData::Builder::adoptEntries(
|
||||
::capnp::Orphan< ::capnp::List< ::stream::metaData::MetaDataEntry, ::capnp::Kind::STRUCT>>&& value) {
|
||||
::capnp::_::PointerHelpers< ::capnp::List< ::stream::metaData::MetaDataEntry, ::capnp::Kind::STRUCT>>::adopt(_builder.getPointerField(
|
||||
::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value));
|
||||
}
|
||||
inline ::capnp::Orphan< ::capnp::List< ::stream::metaData::MetaDataEntry, ::capnp::Kind::STRUCT>> MetaData::Builder::disownEntries() {
|
||||
return ::capnp::_::PointerHelpers< ::capnp::List< ::stream::metaData::MetaDataEntry, ::capnp::Kind::STRUCT>>::disown(_builder.getPointerField(
|
||||
::capnp::bounded<0>() * ::capnp::POINTERS));
|
||||
}
|
||||
|
||||
} // namespace
|
||||
} // namespace
|
||||
|
||||
CAPNP_END_HEADER
|
||||
|
||||
|
|
@ -0,0 +1,78 @@
|
|||
// Generated by Cap'n Proto compiler, DO NOT EDIT
|
||||
// source: metaDataView.capnp
|
||||
|
||||
#include "metaDataView.capnp.h"
|
||||
|
||||
namespace capnp {
|
||||
namespace schemas {
|
||||
static const ::capnp::_::AlignedData<33> b_8ff3115ade0dced6 = {
|
||||
{ 0, 0, 0, 0, 5, 0, 6, 0,
|
||||
214, 206, 13, 222, 90, 17, 243, 143,
|
||||
19, 0, 0, 0, 1, 0, 0, 0,
|
||||
37, 235, 246, 245, 136, 214, 1, 244,
|
||||
1, 0, 7, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
21, 0, 0, 0, 2, 1, 0, 0,
|
||||
33, 0, 0, 0, 7, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
29, 0, 0, 0, 63, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
109, 101, 116, 97, 68, 97, 116, 97,
|
||||
86, 105, 101, 119, 46, 99, 97, 112,
|
||||
110, 112, 58, 77, 101, 116, 97, 68,
|
||||
97, 116, 97, 86, 105, 101, 119, 0,
|
||||
0, 0, 0, 0, 1, 0, 1, 0,
|
||||
4, 0, 0, 0, 3, 0, 4, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 1, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
13, 0, 0, 0, 42, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
8, 0, 0, 0, 3, 0, 1, 0,
|
||||
20, 0, 0, 0, 2, 0, 1, 0,
|
||||
100, 97, 116, 97, 0, 0, 0, 0,
|
||||
16, 0, 0, 0, 0, 0, 0, 0,
|
||||
56, 212, 213, 232, 233, 209, 66, 147,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
16, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, }
|
||||
};
|
||||
::capnp::word const* const bp_8ff3115ade0dced6 = b_8ff3115ade0dced6.words;
|
||||
#if !CAPNP_LITE
|
||||
static const ::capnp::_::RawSchema* const d_8ff3115ade0dced6[] = {
|
||||
&s_9342d1e9e8d5d438,
|
||||
};
|
||||
static const uint16_t m_8ff3115ade0dced6[] = {0};
|
||||
static const uint16_t i_8ff3115ade0dced6[] = {0};
|
||||
const ::capnp::_::RawSchema s_8ff3115ade0dced6 = {
|
||||
0x8ff3115ade0dced6, b_8ff3115ade0dced6.words, 33, d_8ff3115ade0dced6, m_8ff3115ade0dced6,
|
||||
1, 1, i_8ff3115ade0dced6, nullptr, nullptr, { &s_8ff3115ade0dced6, nullptr, nullptr, 0, 0, nullptr }, false
|
||||
};
|
||||
#endif // !CAPNP_LITE
|
||||
} // namespace schemas
|
||||
} // namespace capnp
|
||||
|
||||
// =======================================================================================
|
||||
|
||||
namespace stream {
|
||||
namespace metaDataView {
|
||||
|
||||
// MetaDataView
|
||||
#if CAPNP_NEED_REDUNDANT_CONSTEXPR_DECL
|
||||
constexpr uint16_t MetaDataView::_capnpPrivate::dataWordSize;
|
||||
constexpr uint16_t MetaDataView::_capnpPrivate::pointerCount;
|
||||
#endif // !CAPNP_NEED_REDUNDANT_CONSTEXPR_DECL
|
||||
#if !CAPNP_LITE
|
||||
#if CAPNP_NEED_REDUNDANT_CONSTEXPR_DECL
|
||||
constexpr ::capnp::Kind MetaDataView::_capnpPrivate::kind;
|
||||
constexpr ::capnp::_::RawSchema const* MetaDataView::_capnpPrivate::schema;
|
||||
#endif // !CAPNP_NEED_REDUNDANT_CONSTEXPR_DECL
|
||||
#endif // !CAPNP_LITE
|
||||
|
||||
|
||||
} // namespace
|
||||
} // namespace
|
||||
|
||||
|
|
@ -0,0 +1,174 @@
|
|||
// Generated by Cap'n Proto compiler, DO NOT EDIT
|
||||
// source: metaDataView.capnp
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <capnp/generated-header-support.h>
|
||||
#include <kj/windows-sanity.h>
|
||||
|
||||
#ifndef CAPNP_VERSION
|
||||
#error "CAPNP_VERSION is not defined, is capnp/generated-header-support.h missing?"
|
||||
#elif CAPNP_VERSION != 1000001
|
||||
#error "Version mismatch between generated code and library headers. You must use the same version of the Cap'n Proto compiler and library."
|
||||
#endif
|
||||
|
||||
#include "metaData.capnp.h"
|
||||
|
||||
CAPNP_BEGIN_HEADER
|
||||
|
||||
namespace capnp {
|
||||
namespace schemas {
|
||||
|
||||
CAPNP_DECLARE_SCHEMA(8ff3115ade0dced6);
|
||||
|
||||
} // namespace schemas
|
||||
} // namespace capnp
|
||||
|
||||
namespace stream {
|
||||
namespace metaDataView {
|
||||
|
||||
struct MetaDataView {
|
||||
MetaDataView() = delete;
|
||||
|
||||
class Reader;
|
||||
class Builder;
|
||||
class Pipeline;
|
||||
|
||||
struct _capnpPrivate {
|
||||
CAPNP_DECLARE_STRUCT_HEADER(8ff3115ade0dced6, 0, 1)
|
||||
#if !CAPNP_LITE
|
||||
static constexpr ::capnp::_::RawBrandedSchema const* brand() { return &schema->defaultBrand; }
|
||||
#endif // !CAPNP_LITE
|
||||
};
|
||||
};
|
||||
|
||||
// =======================================================================================
|
||||
|
||||
class MetaDataView::Reader {
|
||||
public:
|
||||
typedef MetaDataView Reads;
|
||||
|
||||
Reader() = default;
|
||||
inline explicit Reader(::capnp::_::StructReader base): _reader(base) {}
|
||||
|
||||
inline ::capnp::MessageSize totalSize() const {
|
||||
return _reader.totalSize().asPublic();
|
||||
}
|
||||
|
||||
#if !CAPNP_LITE
|
||||
inline ::kj::StringTree toString() const {
|
||||
return ::capnp::_::structString(_reader, *_capnpPrivate::brand());
|
||||
}
|
||||
#endif // !CAPNP_LITE
|
||||
|
||||
inline bool hasData() const;
|
||||
inline ::stream::metaData::MetaData::Reader getData() const;
|
||||
|
||||
private:
|
||||
::capnp::_::StructReader _reader;
|
||||
template <typename, ::capnp::Kind>
|
||||
friend struct ::capnp::ToDynamic_;
|
||||
template <typename, ::capnp::Kind>
|
||||
friend struct ::capnp::_::PointerHelpers;
|
||||
template <typename, ::capnp::Kind>
|
||||
friend struct ::capnp::List;
|
||||
friend class ::capnp::MessageBuilder;
|
||||
friend class ::capnp::Orphanage;
|
||||
};
|
||||
|
||||
class MetaDataView::Builder {
|
||||
public:
|
||||
typedef MetaDataView Builds;
|
||||
|
||||
Builder() = delete; // Deleted to discourage incorrect usage.
|
||||
// You can explicitly initialize to nullptr instead.
|
||||
inline Builder(decltype(nullptr)) {}
|
||||
inline explicit Builder(::capnp::_::StructBuilder base): _builder(base) {}
|
||||
inline operator Reader() const { return Reader(_builder.asReader()); }
|
||||
inline Reader asReader() const { return *this; }
|
||||
|
||||
inline ::capnp::MessageSize totalSize() const { return asReader().totalSize(); }
|
||||
#if !CAPNP_LITE
|
||||
inline ::kj::StringTree toString() const { return asReader().toString(); }
|
||||
#endif // !CAPNP_LITE
|
||||
|
||||
inline bool hasData();
|
||||
inline ::stream::metaData::MetaData::Builder getData();
|
||||
inline void setData( ::stream::metaData::MetaData::Reader value);
|
||||
inline ::stream::metaData::MetaData::Builder initData();
|
||||
inline void adoptData(::capnp::Orphan< ::stream::metaData::MetaData>&& value);
|
||||
inline ::capnp::Orphan< ::stream::metaData::MetaData> disownData();
|
||||
|
||||
private:
|
||||
::capnp::_::StructBuilder _builder;
|
||||
template <typename, ::capnp::Kind>
|
||||
friend struct ::capnp::ToDynamic_;
|
||||
friend class ::capnp::Orphanage;
|
||||
template <typename, ::capnp::Kind>
|
||||
friend struct ::capnp::_::PointerHelpers;
|
||||
};
|
||||
|
||||
#if !CAPNP_LITE
|
||||
class MetaDataView::Pipeline {
|
||||
public:
|
||||
typedef MetaDataView Pipelines;
|
||||
|
||||
inline Pipeline(decltype(nullptr)): _typeless(nullptr) {}
|
||||
inline explicit Pipeline(::capnp::AnyPointer::Pipeline&& typeless)
|
||||
: _typeless(kj::mv(typeless)) {}
|
||||
|
||||
inline ::stream::metaData::MetaData::Pipeline getData();
|
||||
private:
|
||||
::capnp::AnyPointer::Pipeline _typeless;
|
||||
friend class ::capnp::PipelineHook;
|
||||
template <typename, ::capnp::Kind>
|
||||
friend struct ::capnp::ToDynamic_;
|
||||
};
|
||||
#endif // !CAPNP_LITE
|
||||
|
||||
// =======================================================================================
|
||||
|
||||
inline bool MetaDataView::Reader::hasData() const {
|
||||
return !_reader.getPointerField(
|
||||
::capnp::bounded<0>() * ::capnp::POINTERS).isNull();
|
||||
}
|
||||
inline bool MetaDataView::Builder::hasData() {
|
||||
return !_builder.getPointerField(
|
||||
::capnp::bounded<0>() * ::capnp::POINTERS).isNull();
|
||||
}
|
||||
inline ::stream::metaData::MetaData::Reader MetaDataView::Reader::getData() const {
|
||||
return ::capnp::_::PointerHelpers< ::stream::metaData::MetaData>::get(_reader.getPointerField(
|
||||
::capnp::bounded<0>() * ::capnp::POINTERS));
|
||||
}
|
||||
inline ::stream::metaData::MetaData::Builder MetaDataView::Builder::getData() {
|
||||
return ::capnp::_::PointerHelpers< ::stream::metaData::MetaData>::get(_builder.getPointerField(
|
||||
::capnp::bounded<0>() * ::capnp::POINTERS));
|
||||
}
|
||||
#if !CAPNP_LITE
|
||||
inline ::stream::metaData::MetaData::Pipeline MetaDataView::Pipeline::getData() {
|
||||
return ::stream::metaData::MetaData::Pipeline(_typeless.getPointerField(0));
|
||||
}
|
||||
#endif // !CAPNP_LITE
|
||||
inline void MetaDataView::Builder::setData( ::stream::metaData::MetaData::Reader value) {
|
||||
::capnp::_::PointerHelpers< ::stream::metaData::MetaData>::set(_builder.getPointerField(
|
||||
::capnp::bounded<0>() * ::capnp::POINTERS), value);
|
||||
}
|
||||
inline ::stream::metaData::MetaData::Builder MetaDataView::Builder::initData() {
|
||||
return ::capnp::_::PointerHelpers< ::stream::metaData::MetaData>::init(_builder.getPointerField(
|
||||
::capnp::bounded<0>() * ::capnp::POINTERS));
|
||||
}
|
||||
inline void MetaDataView::Builder::adoptData(
|
||||
::capnp::Orphan< ::stream::metaData::MetaData>&& value) {
|
||||
::capnp::_::PointerHelpers< ::stream::metaData::MetaData>::adopt(_builder.getPointerField(
|
||||
::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value));
|
||||
}
|
||||
inline ::capnp::Orphan< ::stream::metaData::MetaData> MetaDataView::Builder::disownData() {
|
||||
return ::capnp::_::PointerHelpers< ::stream::metaData::MetaData>::disown(_builder.getPointerField(
|
||||
::capnp::bounded<0>() * ::capnp::POINTERS));
|
||||
}
|
||||
|
||||
} // namespace
|
||||
} // namespace
|
||||
|
||||
CAPNP_END_HEADER
|
||||
|
||||
|
|
@ -0,0 +1,232 @@
|
|||
// Generated by Cap'n Proto compiler, DO NOT EDIT
|
||||
// source: propertySet.capnp
|
||||
|
||||
#include "propertySet.capnp.h"
|
||||
|
||||
namespace capnp {
|
||||
namespace schemas {
|
||||
static const ::capnp::_::AlignedData<49> b_ab971fd3eda1ed27 = {
|
||||
{ 0, 0, 0, 0, 5, 0, 6, 0,
|
||||
39, 237, 161, 237, 211, 31, 151, 171,
|
||||
18, 0, 0, 0, 1, 0, 1, 0,
|
||||
244, 191, 20, 32, 245, 192, 68, 163,
|
||||
1, 0, 7, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
21, 0, 0, 0, 250, 0, 0, 0,
|
||||
33, 0, 0, 0, 7, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
29, 0, 0, 0, 119, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
112, 114, 111, 112, 101, 114, 116, 121,
|
||||
83, 101, 116, 46, 99, 97, 112, 110,
|
||||
112, 58, 80, 114, 111, 112, 101, 114,
|
||||
116, 121, 78, 97, 109, 101, 0, 0,
|
||||
0, 0, 0, 0, 1, 0, 1, 0,
|
||||
8, 0, 0, 0, 3, 0, 4, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 1, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
41, 0, 0, 0, 98, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
40, 0, 0, 0, 3, 0, 1, 0,
|
||||
52, 0, 0, 0, 2, 0, 1, 0,
|
||||
1, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 1, 0, 1, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
49, 0, 0, 0, 42, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
44, 0, 0, 0, 3, 0, 1, 0,
|
||||
56, 0, 0, 0, 2, 0, 1, 0,
|
||||
110, 97, 109, 101, 115, 112, 97, 99,
|
||||
101, 73, 100, 0, 0, 0, 0, 0,
|
||||
9, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
9, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
110, 97, 109, 101, 0, 0, 0, 0,
|
||||
16, 0, 0, 0, 0, 0, 0, 0,
|
||||
198, 25, 189, 174, 235, 112, 106, 249,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
16, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, }
|
||||
};
|
||||
::capnp::word const* const bp_ab971fd3eda1ed27 = b_ab971fd3eda1ed27.words;
|
||||
#if !CAPNP_LITE
|
||||
static const ::capnp::_::RawSchema* const d_ab971fd3eda1ed27[] = {
|
||||
&s_f96a70ebaebd19c6,
|
||||
};
|
||||
static const uint16_t m_ab971fd3eda1ed27[] = {1, 0};
|
||||
static const uint16_t i_ab971fd3eda1ed27[] = {0, 1};
|
||||
const ::capnp::_::RawSchema s_ab971fd3eda1ed27 = {
|
||||
0xab971fd3eda1ed27, b_ab971fd3eda1ed27.words, 49, d_ab971fd3eda1ed27, m_ab971fd3eda1ed27,
|
||||
1, 2, i_ab971fd3eda1ed27, nullptr, nullptr, { &s_ab971fd3eda1ed27, nullptr, nullptr, 0, 0, nullptr }, false
|
||||
};
|
||||
#endif // !CAPNP_LITE
|
||||
static const ::capnp::_::AlignedData<48> b_c5163eb42a82d19a = {
|
||||
{ 0, 0, 0, 0, 5, 0, 6, 0,
|
||||
154, 209, 130, 42, 180, 62, 22, 197,
|
||||
18, 0, 0, 0, 1, 0, 1, 0,
|
||||
244, 191, 20, 32, 245, 192, 68, 163,
|
||||
1, 0, 7, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
21, 0, 0, 0, 234, 0, 0, 0,
|
||||
33, 0, 0, 0, 7, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
29, 0, 0, 0, 119, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
112, 114, 111, 112, 101, 114, 116, 121,
|
||||
83, 101, 116, 46, 99, 97, 112, 110,
|
||||
112, 58, 78, 97, 109, 101, 100, 86,
|
||||
97, 108, 117, 101, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 1, 0, 1, 0,
|
||||
8, 0, 0, 0, 3, 0, 4, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 1, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
41, 0, 0, 0, 58, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
36, 0, 0, 0, 3, 0, 1, 0,
|
||||
48, 0, 0, 0, 2, 0, 1, 0,
|
||||
1, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 1, 0, 1, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
45, 0, 0, 0, 50, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
40, 0, 0, 0, 3, 0, 1, 0,
|
||||
52, 0, 0, 0, 2, 0, 1, 0,
|
||||
110, 97, 109, 101, 73, 100, 0, 0,
|
||||
9, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
9, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
118, 97, 108, 117, 101, 0, 0, 0,
|
||||
16, 0, 0, 0, 0, 0, 0, 0,
|
||||
198, 25, 189, 174, 235, 112, 106, 249,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
16, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, }
|
||||
};
|
||||
::capnp::word const* const bp_c5163eb42a82d19a = b_c5163eb42a82d19a.words;
|
||||
#if !CAPNP_LITE
|
||||
static const ::capnp::_::RawSchema* const d_c5163eb42a82d19a[] = {
|
||||
&s_f96a70ebaebd19c6,
|
||||
};
|
||||
static const uint16_t m_c5163eb42a82d19a[] = {0, 1};
|
||||
static const uint16_t i_c5163eb42a82d19a[] = {0, 1};
|
||||
const ::capnp::_::RawSchema s_c5163eb42a82d19a = {
|
||||
0xc5163eb42a82d19a, b_c5163eb42a82d19a.words, 48, d_c5163eb42a82d19a, m_c5163eb42a82d19a,
|
||||
1, 2, i_c5163eb42a82d19a, nullptr, nullptr, { &s_c5163eb42a82d19a, nullptr, nullptr, 0, 0, nullptr }, false
|
||||
};
|
||||
#endif // !CAPNP_LITE
|
||||
static const ::capnp::_::AlignedData<38> b_ee9f1a259aa6017f = {
|
||||
{ 0, 0, 0, 0, 5, 0, 6, 0,
|
||||
127, 1, 166, 154, 37, 26, 159, 238,
|
||||
18, 0, 0, 0, 1, 0, 0, 0,
|
||||
244, 191, 20, 32, 245, 192, 68, 163,
|
||||
1, 0, 7, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
21, 0, 0, 0, 242, 0, 0, 0,
|
||||
33, 0, 0, 0, 7, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
29, 0, 0, 0, 63, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
112, 114, 111, 112, 101, 114, 116, 121,
|
||||
83, 101, 116, 46, 99, 97, 112, 110,
|
||||
112, 58, 80, 114, 111, 112, 101, 114,
|
||||
116, 121, 83, 101, 116, 0, 0, 0,
|
||||
0, 0, 0, 0, 1, 0, 1, 0,
|
||||
4, 0, 0, 0, 3, 0, 4, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 1, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
13, 0, 0, 0, 90, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
12, 0, 0, 0, 3, 0, 1, 0,
|
||||
40, 0, 0, 0, 2, 0, 1, 0,
|
||||
112, 114, 111, 112, 101, 114, 116, 105,
|
||||
101, 115, 0, 0, 0, 0, 0, 0,
|
||||
14, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 3, 0, 1, 0,
|
||||
16, 0, 0, 0, 0, 0, 0, 0,
|
||||
154, 209, 130, 42, 180, 62, 22, 197,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
14, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, }
|
||||
};
|
||||
::capnp::word const* const bp_ee9f1a259aa6017f = b_ee9f1a259aa6017f.words;
|
||||
#if !CAPNP_LITE
|
||||
static const ::capnp::_::RawSchema* const d_ee9f1a259aa6017f[] = {
|
||||
&s_c5163eb42a82d19a,
|
||||
};
|
||||
static const uint16_t m_ee9f1a259aa6017f[] = {0};
|
||||
static const uint16_t i_ee9f1a259aa6017f[] = {0};
|
||||
const ::capnp::_::RawSchema s_ee9f1a259aa6017f = {
|
||||
0xee9f1a259aa6017f, b_ee9f1a259aa6017f.words, 38, d_ee9f1a259aa6017f, m_ee9f1a259aa6017f,
|
||||
1, 1, i_ee9f1a259aa6017f, nullptr, nullptr, { &s_ee9f1a259aa6017f, nullptr, nullptr, 0, 0, nullptr }, false
|
||||
};
|
||||
#endif // !CAPNP_LITE
|
||||
} // namespace schemas
|
||||
} // namespace capnp
|
||||
|
||||
// =======================================================================================
|
||||
|
||||
namespace stream {
|
||||
namespace propertySet {
|
||||
|
||||
// PropertyName
|
||||
#if CAPNP_NEED_REDUNDANT_CONSTEXPR_DECL
|
||||
constexpr uint16_t PropertyName::_capnpPrivate::dataWordSize;
|
||||
constexpr uint16_t PropertyName::_capnpPrivate::pointerCount;
|
||||
#endif // !CAPNP_NEED_REDUNDANT_CONSTEXPR_DECL
|
||||
#if !CAPNP_LITE
|
||||
#if CAPNP_NEED_REDUNDANT_CONSTEXPR_DECL
|
||||
constexpr ::capnp::Kind PropertyName::_capnpPrivate::kind;
|
||||
constexpr ::capnp::_::RawSchema const* PropertyName::_capnpPrivate::schema;
|
||||
#endif // !CAPNP_NEED_REDUNDANT_CONSTEXPR_DECL
|
||||
#endif // !CAPNP_LITE
|
||||
|
||||
// NamedValue
|
||||
#if CAPNP_NEED_REDUNDANT_CONSTEXPR_DECL
|
||||
constexpr uint16_t NamedValue::_capnpPrivate::dataWordSize;
|
||||
constexpr uint16_t NamedValue::_capnpPrivate::pointerCount;
|
||||
#endif // !CAPNP_NEED_REDUNDANT_CONSTEXPR_DECL
|
||||
#if !CAPNP_LITE
|
||||
#if CAPNP_NEED_REDUNDANT_CONSTEXPR_DECL
|
||||
constexpr ::capnp::Kind NamedValue::_capnpPrivate::kind;
|
||||
constexpr ::capnp::_::RawSchema const* NamedValue::_capnpPrivate::schema;
|
||||
#endif // !CAPNP_NEED_REDUNDANT_CONSTEXPR_DECL
|
||||
#endif // !CAPNP_LITE
|
||||
|
||||
// PropertySet
|
||||
#if CAPNP_NEED_REDUNDANT_CONSTEXPR_DECL
|
||||
constexpr uint16_t PropertySet::_capnpPrivate::dataWordSize;
|
||||
constexpr uint16_t PropertySet::_capnpPrivate::pointerCount;
|
||||
#endif // !CAPNP_NEED_REDUNDANT_CONSTEXPR_DECL
|
||||
#if !CAPNP_LITE
|
||||
#if CAPNP_NEED_REDUNDANT_CONSTEXPR_DECL
|
||||
constexpr ::capnp::Kind PropertySet::_capnpPrivate::kind;
|
||||
constexpr ::capnp::_::RawSchema const* PropertySet::_capnpPrivate::schema;
|
||||
#endif // !CAPNP_NEED_REDUNDANT_CONSTEXPR_DECL
|
||||
#endif // !CAPNP_LITE
|
||||
|
||||
|
||||
} // namespace
|
||||
} // namespace
|
||||
|
||||
|
|
@ -0,0 +1,480 @@
|
|||
// Generated by Cap'n Proto compiler, DO NOT EDIT
|
||||
// source: propertySet.capnp
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <capnp/generated-header-support.h>
|
||||
#include <kj/windows-sanity.h>
|
||||
|
||||
#ifndef CAPNP_VERSION
|
||||
#error "CAPNP_VERSION is not defined, is capnp/generated-header-support.h missing?"
|
||||
#elif CAPNP_VERSION != 1000001
|
||||
#error "Version mismatch between generated code and library headers. You must use the same version of the Cap'n Proto compiler and library."
|
||||
#endif
|
||||
|
||||
#include "variant.capnp.h"
|
||||
|
||||
CAPNP_BEGIN_HEADER
|
||||
|
||||
namespace capnp {
|
||||
namespace schemas {
|
||||
|
||||
CAPNP_DECLARE_SCHEMA(ab971fd3eda1ed27);
|
||||
CAPNP_DECLARE_SCHEMA(c5163eb42a82d19a);
|
||||
CAPNP_DECLARE_SCHEMA(ee9f1a259aa6017f);
|
||||
|
||||
} // namespace schemas
|
||||
} // namespace capnp
|
||||
|
||||
namespace stream {
|
||||
namespace propertySet {
|
||||
|
||||
struct PropertyName {
|
||||
PropertyName() = delete;
|
||||
|
||||
class Reader;
|
||||
class Builder;
|
||||
class Pipeline;
|
||||
|
||||
struct _capnpPrivate {
|
||||
CAPNP_DECLARE_STRUCT_HEADER(ab971fd3eda1ed27, 1, 1)
|
||||
#if !CAPNP_LITE
|
||||
static constexpr ::capnp::_::RawBrandedSchema const* brand() { return &schema->defaultBrand; }
|
||||
#endif // !CAPNP_LITE
|
||||
};
|
||||
};
|
||||
|
||||
struct NamedValue {
|
||||
NamedValue() = delete;
|
||||
|
||||
class Reader;
|
||||
class Builder;
|
||||
class Pipeline;
|
||||
|
||||
struct _capnpPrivate {
|
||||
CAPNP_DECLARE_STRUCT_HEADER(c5163eb42a82d19a, 1, 1)
|
||||
#if !CAPNP_LITE
|
||||
static constexpr ::capnp::_::RawBrandedSchema const* brand() { return &schema->defaultBrand; }
|
||||
#endif // !CAPNP_LITE
|
||||
};
|
||||
};
|
||||
|
||||
struct PropertySet {
|
||||
PropertySet() = delete;
|
||||
|
||||
class Reader;
|
||||
class Builder;
|
||||
class Pipeline;
|
||||
|
||||
struct _capnpPrivate {
|
||||
CAPNP_DECLARE_STRUCT_HEADER(ee9f1a259aa6017f, 0, 1)
|
||||
#if !CAPNP_LITE
|
||||
static constexpr ::capnp::_::RawBrandedSchema const* brand() { return &schema->defaultBrand; }
|
||||
#endif // !CAPNP_LITE
|
||||
};
|
||||
};
|
||||
|
||||
// =======================================================================================
|
||||
|
||||
class PropertyName::Reader {
|
||||
public:
|
||||
typedef PropertyName Reads;
|
||||
|
||||
Reader() = default;
|
||||
inline explicit Reader(::capnp::_::StructReader base): _reader(base) {}
|
||||
|
||||
inline ::capnp::MessageSize totalSize() const {
|
||||
return _reader.totalSize().asPublic();
|
||||
}
|
||||
|
||||
#if !CAPNP_LITE
|
||||
inline ::kj::StringTree toString() const {
|
||||
return ::capnp::_::structString(_reader, *_capnpPrivate::brand());
|
||||
}
|
||||
#endif // !CAPNP_LITE
|
||||
|
||||
inline ::uint64_t getNamespaceId() const;
|
||||
|
||||
inline bool hasName() const;
|
||||
inline ::stream::variant::Variant::Reader getName() const;
|
||||
|
||||
private:
|
||||
::capnp::_::StructReader _reader;
|
||||
template <typename, ::capnp::Kind>
|
||||
friend struct ::capnp::ToDynamic_;
|
||||
template <typename, ::capnp::Kind>
|
||||
friend struct ::capnp::_::PointerHelpers;
|
||||
template <typename, ::capnp::Kind>
|
||||
friend struct ::capnp::List;
|
||||
friend class ::capnp::MessageBuilder;
|
||||
friend class ::capnp::Orphanage;
|
||||
};
|
||||
|
||||
class PropertyName::Builder {
|
||||
public:
|
||||
typedef PropertyName Builds;
|
||||
|
||||
Builder() = delete; // Deleted to discourage incorrect usage.
|
||||
// You can explicitly initialize to nullptr instead.
|
||||
inline Builder(decltype(nullptr)) {}
|
||||
inline explicit Builder(::capnp::_::StructBuilder base): _builder(base) {}
|
||||
inline operator Reader() const { return Reader(_builder.asReader()); }
|
||||
inline Reader asReader() const { return *this; }
|
||||
|
||||
inline ::capnp::MessageSize totalSize() const { return asReader().totalSize(); }
|
||||
#if !CAPNP_LITE
|
||||
inline ::kj::StringTree toString() const { return asReader().toString(); }
|
||||
#endif // !CAPNP_LITE
|
||||
|
||||
inline ::uint64_t getNamespaceId();
|
||||
inline void setNamespaceId( ::uint64_t value);
|
||||
|
||||
inline bool hasName();
|
||||
inline ::stream::variant::Variant::Builder getName();
|
||||
inline void setName( ::stream::variant::Variant::Reader value);
|
||||
inline ::stream::variant::Variant::Builder initName();
|
||||
inline void adoptName(::capnp::Orphan< ::stream::variant::Variant>&& value);
|
||||
inline ::capnp::Orphan< ::stream::variant::Variant> disownName();
|
||||
|
||||
private:
|
||||
::capnp::_::StructBuilder _builder;
|
||||
template <typename, ::capnp::Kind>
|
||||
friend struct ::capnp::ToDynamic_;
|
||||
friend class ::capnp::Orphanage;
|
||||
template <typename, ::capnp::Kind>
|
||||
friend struct ::capnp::_::PointerHelpers;
|
||||
};
|
||||
|
||||
#if !CAPNP_LITE
|
||||
class PropertyName::Pipeline {
|
||||
public:
|
||||
typedef PropertyName Pipelines;
|
||||
|
||||
inline Pipeline(decltype(nullptr)): _typeless(nullptr) {}
|
||||
inline explicit Pipeline(::capnp::AnyPointer::Pipeline&& typeless)
|
||||
: _typeless(kj::mv(typeless)) {}
|
||||
|
||||
inline ::stream::variant::Variant::Pipeline getName();
|
||||
private:
|
||||
::capnp::AnyPointer::Pipeline _typeless;
|
||||
friend class ::capnp::PipelineHook;
|
||||
template <typename, ::capnp::Kind>
|
||||
friend struct ::capnp::ToDynamic_;
|
||||
};
|
||||
#endif // !CAPNP_LITE
|
||||
|
||||
class NamedValue::Reader {
|
||||
public:
|
||||
typedef NamedValue Reads;
|
||||
|
||||
Reader() = default;
|
||||
inline explicit Reader(::capnp::_::StructReader base): _reader(base) {}
|
||||
|
||||
inline ::capnp::MessageSize totalSize() const {
|
||||
return _reader.totalSize().asPublic();
|
||||
}
|
||||
|
||||
#if !CAPNP_LITE
|
||||
inline ::kj::StringTree toString() const {
|
||||
return ::capnp::_::structString(_reader, *_capnpPrivate::brand());
|
||||
}
|
||||
#endif // !CAPNP_LITE
|
||||
|
||||
inline ::uint64_t getNameId() const;
|
||||
|
||||
inline bool hasValue() const;
|
||||
inline ::stream::variant::Variant::Reader getValue() const;
|
||||
|
||||
private:
|
||||
::capnp::_::StructReader _reader;
|
||||
template <typename, ::capnp::Kind>
|
||||
friend struct ::capnp::ToDynamic_;
|
||||
template <typename, ::capnp::Kind>
|
||||
friend struct ::capnp::_::PointerHelpers;
|
||||
template <typename, ::capnp::Kind>
|
||||
friend struct ::capnp::List;
|
||||
friend class ::capnp::MessageBuilder;
|
||||
friend class ::capnp::Orphanage;
|
||||
};
|
||||
|
||||
class NamedValue::Builder {
|
||||
public:
|
||||
typedef NamedValue Builds;
|
||||
|
||||
Builder() = delete; // Deleted to discourage incorrect usage.
|
||||
// You can explicitly initialize to nullptr instead.
|
||||
inline Builder(decltype(nullptr)) {}
|
||||
inline explicit Builder(::capnp::_::StructBuilder base): _builder(base) {}
|
||||
inline operator Reader() const { return Reader(_builder.asReader()); }
|
||||
inline Reader asReader() const { return *this; }
|
||||
|
||||
inline ::capnp::MessageSize totalSize() const { return asReader().totalSize(); }
|
||||
#if !CAPNP_LITE
|
||||
inline ::kj::StringTree toString() const { return asReader().toString(); }
|
||||
#endif // !CAPNP_LITE
|
||||
|
||||
inline ::uint64_t getNameId();
|
||||
inline void setNameId( ::uint64_t value);
|
||||
|
||||
inline bool hasValue();
|
||||
inline ::stream::variant::Variant::Builder getValue();
|
||||
inline void setValue( ::stream::variant::Variant::Reader value);
|
||||
inline ::stream::variant::Variant::Builder initValue();
|
||||
inline void adoptValue(::capnp::Orphan< ::stream::variant::Variant>&& value);
|
||||
inline ::capnp::Orphan< ::stream::variant::Variant> disownValue();
|
||||
|
||||
private:
|
||||
::capnp::_::StructBuilder _builder;
|
||||
template <typename, ::capnp::Kind>
|
||||
friend struct ::capnp::ToDynamic_;
|
||||
friend class ::capnp::Orphanage;
|
||||
template <typename, ::capnp::Kind>
|
||||
friend struct ::capnp::_::PointerHelpers;
|
||||
};
|
||||
|
||||
#if !CAPNP_LITE
|
||||
class NamedValue::Pipeline {
|
||||
public:
|
||||
typedef NamedValue Pipelines;
|
||||
|
||||
inline Pipeline(decltype(nullptr)): _typeless(nullptr) {}
|
||||
inline explicit Pipeline(::capnp::AnyPointer::Pipeline&& typeless)
|
||||
: _typeless(kj::mv(typeless)) {}
|
||||
|
||||
inline ::stream::variant::Variant::Pipeline getValue();
|
||||
private:
|
||||
::capnp::AnyPointer::Pipeline _typeless;
|
||||
friend class ::capnp::PipelineHook;
|
||||
template <typename, ::capnp::Kind>
|
||||
friend struct ::capnp::ToDynamic_;
|
||||
};
|
||||
#endif // !CAPNP_LITE
|
||||
|
||||
class PropertySet::Reader {
|
||||
public:
|
||||
typedef PropertySet Reads;
|
||||
|
||||
Reader() = default;
|
||||
inline explicit Reader(::capnp::_::StructReader base): _reader(base) {}
|
||||
|
||||
inline ::capnp::MessageSize totalSize() const {
|
||||
return _reader.totalSize().asPublic();
|
||||
}
|
||||
|
||||
#if !CAPNP_LITE
|
||||
inline ::kj::StringTree toString() const {
|
||||
return ::capnp::_::structString(_reader, *_capnpPrivate::brand());
|
||||
}
|
||||
#endif // !CAPNP_LITE
|
||||
|
||||
inline bool hasProperties() const;
|
||||
inline ::capnp::List< ::stream::propertySet::NamedValue, ::capnp::Kind::STRUCT>::Reader getProperties() const;
|
||||
|
||||
private:
|
||||
::capnp::_::StructReader _reader;
|
||||
template <typename, ::capnp::Kind>
|
||||
friend struct ::capnp::ToDynamic_;
|
||||
template <typename, ::capnp::Kind>
|
||||
friend struct ::capnp::_::PointerHelpers;
|
||||
template <typename, ::capnp::Kind>
|
||||
friend struct ::capnp::List;
|
||||
friend class ::capnp::MessageBuilder;
|
||||
friend class ::capnp::Orphanage;
|
||||
};
|
||||
|
||||
class PropertySet::Builder {
|
||||
public:
|
||||
typedef PropertySet Builds;
|
||||
|
||||
Builder() = delete; // Deleted to discourage incorrect usage.
|
||||
// You can explicitly initialize to nullptr instead.
|
||||
inline Builder(decltype(nullptr)) {}
|
||||
inline explicit Builder(::capnp::_::StructBuilder base): _builder(base) {}
|
||||
inline operator Reader() const { return Reader(_builder.asReader()); }
|
||||
inline Reader asReader() const { return *this; }
|
||||
|
||||
inline ::capnp::MessageSize totalSize() const { return asReader().totalSize(); }
|
||||
#if !CAPNP_LITE
|
||||
inline ::kj::StringTree toString() const { return asReader().toString(); }
|
||||
#endif // !CAPNP_LITE
|
||||
|
||||
inline bool hasProperties();
|
||||
inline ::capnp::List< ::stream::propertySet::NamedValue, ::capnp::Kind::STRUCT>::Builder getProperties();
|
||||
inline void setProperties( ::capnp::List< ::stream::propertySet::NamedValue, ::capnp::Kind::STRUCT>::Reader value);
|
||||
inline ::capnp::List< ::stream::propertySet::NamedValue, ::capnp::Kind::STRUCT>::Builder initProperties(unsigned int size);
|
||||
inline void adoptProperties(::capnp::Orphan< ::capnp::List< ::stream::propertySet::NamedValue, ::capnp::Kind::STRUCT>>&& value);
|
||||
inline ::capnp::Orphan< ::capnp::List< ::stream::propertySet::NamedValue, ::capnp::Kind::STRUCT>> disownProperties();
|
||||
|
||||
private:
|
||||
::capnp::_::StructBuilder _builder;
|
||||
template <typename, ::capnp::Kind>
|
||||
friend struct ::capnp::ToDynamic_;
|
||||
friend class ::capnp::Orphanage;
|
||||
template <typename, ::capnp::Kind>
|
||||
friend struct ::capnp::_::PointerHelpers;
|
||||
};
|
||||
|
||||
#if !CAPNP_LITE
|
||||
class PropertySet::Pipeline {
|
||||
public:
|
||||
typedef PropertySet Pipelines;
|
||||
|
||||
inline Pipeline(decltype(nullptr)): _typeless(nullptr) {}
|
||||
inline explicit Pipeline(::capnp::AnyPointer::Pipeline&& typeless)
|
||||
: _typeless(kj::mv(typeless)) {}
|
||||
|
||||
private:
|
||||
::capnp::AnyPointer::Pipeline _typeless;
|
||||
friend class ::capnp::PipelineHook;
|
||||
template <typename, ::capnp::Kind>
|
||||
friend struct ::capnp::ToDynamic_;
|
||||
};
|
||||
#endif // !CAPNP_LITE
|
||||
|
||||
// =======================================================================================
|
||||
|
||||
inline ::uint64_t PropertyName::Reader::getNamespaceId() const {
|
||||
return _reader.getDataField< ::uint64_t>(
|
||||
::capnp::bounded<0>() * ::capnp::ELEMENTS);
|
||||
}
|
||||
|
||||
inline ::uint64_t PropertyName::Builder::getNamespaceId() {
|
||||
return _builder.getDataField< ::uint64_t>(
|
||||
::capnp::bounded<0>() * ::capnp::ELEMENTS);
|
||||
}
|
||||
inline void PropertyName::Builder::setNamespaceId( ::uint64_t value) {
|
||||
_builder.setDataField< ::uint64_t>(
|
||||
::capnp::bounded<0>() * ::capnp::ELEMENTS, value);
|
||||
}
|
||||
|
||||
inline bool PropertyName::Reader::hasName() const {
|
||||
return !_reader.getPointerField(
|
||||
::capnp::bounded<0>() * ::capnp::POINTERS).isNull();
|
||||
}
|
||||
inline bool PropertyName::Builder::hasName() {
|
||||
return !_builder.getPointerField(
|
||||
::capnp::bounded<0>() * ::capnp::POINTERS).isNull();
|
||||
}
|
||||
inline ::stream::variant::Variant::Reader PropertyName::Reader::getName() const {
|
||||
return ::capnp::_::PointerHelpers< ::stream::variant::Variant>::get(_reader.getPointerField(
|
||||
::capnp::bounded<0>() * ::capnp::POINTERS));
|
||||
}
|
||||
inline ::stream::variant::Variant::Builder PropertyName::Builder::getName() {
|
||||
return ::capnp::_::PointerHelpers< ::stream::variant::Variant>::get(_builder.getPointerField(
|
||||
::capnp::bounded<0>() * ::capnp::POINTERS));
|
||||
}
|
||||
#if !CAPNP_LITE
|
||||
inline ::stream::variant::Variant::Pipeline PropertyName::Pipeline::getName() {
|
||||
return ::stream::variant::Variant::Pipeline(_typeless.getPointerField(0));
|
||||
}
|
||||
#endif // !CAPNP_LITE
|
||||
inline void PropertyName::Builder::setName( ::stream::variant::Variant::Reader value) {
|
||||
::capnp::_::PointerHelpers< ::stream::variant::Variant>::set(_builder.getPointerField(
|
||||
::capnp::bounded<0>() * ::capnp::POINTERS), value);
|
||||
}
|
||||
inline ::stream::variant::Variant::Builder PropertyName::Builder::initName() {
|
||||
return ::capnp::_::PointerHelpers< ::stream::variant::Variant>::init(_builder.getPointerField(
|
||||
::capnp::bounded<0>() * ::capnp::POINTERS));
|
||||
}
|
||||
inline void PropertyName::Builder::adoptName(
|
||||
::capnp::Orphan< ::stream::variant::Variant>&& value) {
|
||||
::capnp::_::PointerHelpers< ::stream::variant::Variant>::adopt(_builder.getPointerField(
|
||||
::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value));
|
||||
}
|
||||
inline ::capnp::Orphan< ::stream::variant::Variant> PropertyName::Builder::disownName() {
|
||||
return ::capnp::_::PointerHelpers< ::stream::variant::Variant>::disown(_builder.getPointerField(
|
||||
::capnp::bounded<0>() * ::capnp::POINTERS));
|
||||
}
|
||||
|
||||
inline ::uint64_t NamedValue::Reader::getNameId() const {
|
||||
return _reader.getDataField< ::uint64_t>(
|
||||
::capnp::bounded<0>() * ::capnp::ELEMENTS);
|
||||
}
|
||||
|
||||
inline ::uint64_t NamedValue::Builder::getNameId() {
|
||||
return _builder.getDataField< ::uint64_t>(
|
||||
::capnp::bounded<0>() * ::capnp::ELEMENTS);
|
||||
}
|
||||
inline void NamedValue::Builder::setNameId( ::uint64_t value) {
|
||||
_builder.setDataField< ::uint64_t>(
|
||||
::capnp::bounded<0>() * ::capnp::ELEMENTS, value);
|
||||
}
|
||||
|
||||
inline bool NamedValue::Reader::hasValue() const {
|
||||
return !_reader.getPointerField(
|
||||
::capnp::bounded<0>() * ::capnp::POINTERS).isNull();
|
||||
}
|
||||
inline bool NamedValue::Builder::hasValue() {
|
||||
return !_builder.getPointerField(
|
||||
::capnp::bounded<0>() * ::capnp::POINTERS).isNull();
|
||||
}
|
||||
inline ::stream::variant::Variant::Reader NamedValue::Reader::getValue() const {
|
||||
return ::capnp::_::PointerHelpers< ::stream::variant::Variant>::get(_reader.getPointerField(
|
||||
::capnp::bounded<0>() * ::capnp::POINTERS));
|
||||
}
|
||||
inline ::stream::variant::Variant::Builder NamedValue::Builder::getValue() {
|
||||
return ::capnp::_::PointerHelpers< ::stream::variant::Variant>::get(_builder.getPointerField(
|
||||
::capnp::bounded<0>() * ::capnp::POINTERS));
|
||||
}
|
||||
#if !CAPNP_LITE
|
||||
inline ::stream::variant::Variant::Pipeline NamedValue::Pipeline::getValue() {
|
||||
return ::stream::variant::Variant::Pipeline(_typeless.getPointerField(0));
|
||||
}
|
||||
#endif // !CAPNP_LITE
|
||||
inline void NamedValue::Builder::setValue( ::stream::variant::Variant::Reader value) {
|
||||
::capnp::_::PointerHelpers< ::stream::variant::Variant>::set(_builder.getPointerField(
|
||||
::capnp::bounded<0>() * ::capnp::POINTERS), value);
|
||||
}
|
||||
inline ::stream::variant::Variant::Builder NamedValue::Builder::initValue() {
|
||||
return ::capnp::_::PointerHelpers< ::stream::variant::Variant>::init(_builder.getPointerField(
|
||||
::capnp::bounded<0>() * ::capnp::POINTERS));
|
||||
}
|
||||
inline void NamedValue::Builder::adoptValue(
|
||||
::capnp::Orphan< ::stream::variant::Variant>&& value) {
|
||||
::capnp::_::PointerHelpers< ::stream::variant::Variant>::adopt(_builder.getPointerField(
|
||||
::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value));
|
||||
}
|
||||
inline ::capnp::Orphan< ::stream::variant::Variant> NamedValue::Builder::disownValue() {
|
||||
return ::capnp::_::PointerHelpers< ::stream::variant::Variant>::disown(_builder.getPointerField(
|
||||
::capnp::bounded<0>() * ::capnp::POINTERS));
|
||||
}
|
||||
|
||||
inline bool PropertySet::Reader::hasProperties() const {
|
||||
return !_reader.getPointerField(
|
||||
::capnp::bounded<0>() * ::capnp::POINTERS).isNull();
|
||||
}
|
||||
inline bool PropertySet::Builder::hasProperties() {
|
||||
return !_builder.getPointerField(
|
||||
::capnp::bounded<0>() * ::capnp::POINTERS).isNull();
|
||||
}
|
||||
inline ::capnp::List< ::stream::propertySet::NamedValue, ::capnp::Kind::STRUCT>::Reader PropertySet::Reader::getProperties() const {
|
||||
return ::capnp::_::PointerHelpers< ::capnp::List< ::stream::propertySet::NamedValue, ::capnp::Kind::STRUCT>>::get(_reader.getPointerField(
|
||||
::capnp::bounded<0>() * ::capnp::POINTERS));
|
||||
}
|
||||
inline ::capnp::List< ::stream::propertySet::NamedValue, ::capnp::Kind::STRUCT>::Builder PropertySet::Builder::getProperties() {
|
||||
return ::capnp::_::PointerHelpers< ::capnp::List< ::stream::propertySet::NamedValue, ::capnp::Kind::STRUCT>>::get(_builder.getPointerField(
|
||||
::capnp::bounded<0>() * ::capnp::POINTERS));
|
||||
}
|
||||
inline void PropertySet::Builder::setProperties( ::capnp::List< ::stream::propertySet::NamedValue, ::capnp::Kind::STRUCT>::Reader value) {
|
||||
::capnp::_::PointerHelpers< ::capnp::List< ::stream::propertySet::NamedValue, ::capnp::Kind::STRUCT>>::set(_builder.getPointerField(
|
||||
::capnp::bounded<0>() * ::capnp::POINTERS), value);
|
||||
}
|
||||
inline ::capnp::List< ::stream::propertySet::NamedValue, ::capnp::Kind::STRUCT>::Builder PropertySet::Builder::initProperties(unsigned int size) {
|
||||
return ::capnp::_::PointerHelpers< ::capnp::List< ::stream::propertySet::NamedValue, ::capnp::Kind::STRUCT>>::init(_builder.getPointerField(
|
||||
::capnp::bounded<0>() * ::capnp::POINTERS), size);
|
||||
}
|
||||
inline void PropertySet::Builder::adoptProperties(
|
||||
::capnp::Orphan< ::capnp::List< ::stream::propertySet::NamedValue, ::capnp::Kind::STRUCT>>&& value) {
|
||||
::capnp::_::PointerHelpers< ::capnp::List< ::stream::propertySet::NamedValue, ::capnp::Kind::STRUCT>>::adopt(_builder.getPointerField(
|
||||
::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value));
|
||||
}
|
||||
inline ::capnp::Orphan< ::capnp::List< ::stream::propertySet::NamedValue, ::capnp::Kind::STRUCT>> PropertySet::Builder::disownProperties() {
|
||||
return ::capnp::_::PointerHelpers< ::capnp::List< ::stream::propertySet::NamedValue, ::capnp::Kind::STRUCT>>::disown(_builder.getPointerField(
|
||||
::capnp::bounded<0>() * ::capnp::POINTERS));
|
||||
}
|
||||
|
||||
} // namespace
|
||||
} // namespace
|
||||
|
||||
CAPNP_END_HEADER
|
||||
|
||||
|
|
@ -0,0 +1,452 @@
|
|||
// Generated by Cap'n Proto compiler, DO NOT EDIT
|
||||
// source: repetition.capnp
|
||||
|
||||
#include "repetition.capnp.h"
|
||||
|
||||
namespace capnp {
|
||||
namespace schemas {
|
||||
static const ::capnp::_::AlignedData<79> b_9425aecc5b90c16e = {
|
||||
{ 0, 0, 0, 0, 5, 0, 6, 0,
|
||||
110, 193, 144, 91, 204, 174, 37, 148,
|
||||
17, 0, 0, 0, 1, 0, 4, 0,
|
||||
55, 226, 130, 50, 37, 72, 69, 156,
|
||||
0, 0, 7, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
21, 0, 0, 0, 66, 1, 0, 0,
|
||||
37, 0, 0, 0, 7, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
33, 0, 0, 0, 231, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
114, 101, 112, 101, 116, 105, 116, 105,
|
||||
111, 110, 46, 99, 97, 112, 110, 112,
|
||||
58, 82, 101, 103, 117, 108, 97, 114,
|
||||
79, 114, 116, 104, 111, 82, 101, 112,
|
||||
101, 116, 105, 116, 105, 111, 110, 0,
|
||||
0, 0, 0, 0, 1, 0, 1, 0,
|
||||
16, 0, 0, 0, 3, 0, 4, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 1, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
97, 0, 0, 0, 26, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
92, 0, 0, 0, 3, 0, 1, 0,
|
||||
104, 0, 0, 0, 2, 0, 1, 0,
|
||||
1, 0, 0, 0, 1, 0, 0, 0,
|
||||
0, 0, 1, 0, 1, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
101, 0, 0, 0, 26, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
96, 0, 0, 0, 3, 0, 1, 0,
|
||||
108, 0, 0, 0, 2, 0, 1, 0,
|
||||
2, 0, 0, 0, 2, 0, 0, 0,
|
||||
0, 0, 1, 0, 2, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
105, 0, 0, 0, 26, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
100, 0, 0, 0, 3, 0, 1, 0,
|
||||
112, 0, 0, 0, 2, 0, 1, 0,
|
||||
3, 0, 0, 0, 3, 0, 0, 0,
|
||||
0, 0, 1, 0, 3, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
109, 0, 0, 0, 26, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
104, 0, 0, 0, 3, 0, 1, 0,
|
||||
116, 0, 0, 0, 2, 0, 1, 0,
|
||||
100, 120, 0, 0, 0, 0, 0, 0,
|
||||
5, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
5, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
100, 121, 0, 0, 0, 0, 0, 0,
|
||||
5, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
5, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
110, 120, 0, 0, 0, 0, 0, 0,
|
||||
9, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
9, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
110, 121, 0, 0, 0, 0, 0, 0,
|
||||
9, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
9, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, }
|
||||
};
|
||||
::capnp::word const* const bp_9425aecc5b90c16e = b_9425aecc5b90c16e.words;
|
||||
#if !CAPNP_LITE
|
||||
static const uint16_t m_9425aecc5b90c16e[] = {0, 1, 2, 3};
|
||||
static const uint16_t i_9425aecc5b90c16e[] = {0, 1, 2, 3};
|
||||
const ::capnp::_::RawSchema s_9425aecc5b90c16e = {
|
||||
0x9425aecc5b90c16e, b_9425aecc5b90c16e.words, 79, nullptr, m_9425aecc5b90c16e,
|
||||
0, 4, i_9425aecc5b90c16e, nullptr, nullptr, { &s_9425aecc5b90c16e, nullptr, nullptr, 0, 0, nullptr }, false
|
||||
};
|
||||
#endif // !CAPNP_LITE
|
||||
static const ::capnp::_::AlignedData<79> b_8ad514566ec69992 = {
|
||||
{ 0, 0, 0, 0, 5, 0, 6, 0,
|
||||
146, 153, 198, 110, 86, 20, 213, 138,
|
||||
17, 0, 0, 0, 1, 0, 2, 0,
|
||||
55, 226, 130, 50, 37, 72, 69, 156,
|
||||
2, 0, 7, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
21, 0, 0, 0, 26, 1, 0, 0,
|
||||
37, 0, 0, 0, 7, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
33, 0, 0, 0, 231, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
114, 101, 112, 101, 116, 105, 116, 105,
|
||||
111, 110, 46, 99, 97, 112, 110, 112,
|
||||
58, 82, 101, 103, 117, 108, 97, 114,
|
||||
82, 101, 112, 101, 116, 105, 116, 105,
|
||||
111, 110, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 1, 0, 1, 0,
|
||||
16, 0, 0, 0, 3, 0, 4, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 1, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
97, 0, 0, 0, 18, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
92, 0, 0, 0, 3, 0, 1, 0,
|
||||
104, 0, 0, 0, 2, 0, 1, 0,
|
||||
1, 0, 0, 0, 1, 0, 0, 0,
|
||||
0, 0, 1, 0, 1, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
101, 0, 0, 0, 18, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
96, 0, 0, 0, 3, 0, 1, 0,
|
||||
108, 0, 0, 0, 2, 0, 1, 0,
|
||||
2, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 1, 0, 2, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
105, 0, 0, 0, 26, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
100, 0, 0, 0, 3, 0, 1, 0,
|
||||
112, 0, 0, 0, 2, 0, 1, 0,
|
||||
3, 0, 0, 0, 1, 0, 0, 0,
|
||||
0, 0, 1, 0, 3, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
109, 0, 0, 0, 26, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
104, 0, 0, 0, 3, 0, 1, 0,
|
||||
116, 0, 0, 0, 2, 0, 1, 0,
|
||||
97, 0, 0, 0, 0, 0, 0, 0,
|
||||
16, 0, 0, 0, 0, 0, 0, 0,
|
||||
169, 23, 16, 131, 13, 157, 234, 195,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
16, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
98, 0, 0, 0, 0, 0, 0, 0,
|
||||
16, 0, 0, 0, 0, 0, 0, 0,
|
||||
169, 23, 16, 131, 13, 157, 234, 195,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
16, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
110, 97, 0, 0, 0, 0, 0, 0,
|
||||
9, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
9, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
110, 98, 0, 0, 0, 0, 0, 0,
|
||||
9, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
9, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, }
|
||||
};
|
||||
::capnp::word const* const bp_8ad514566ec69992 = b_8ad514566ec69992.words;
|
||||
#if !CAPNP_LITE
|
||||
static const ::capnp::_::RawSchema* const d_8ad514566ec69992[] = {
|
||||
&s_c3ea9d0d831017a9,
|
||||
};
|
||||
static const uint16_t m_8ad514566ec69992[] = {0, 1, 2, 3};
|
||||
static const uint16_t i_8ad514566ec69992[] = {0, 1, 2, 3};
|
||||
const ::capnp::_::RawSchema s_8ad514566ec69992 = {
|
||||
0x8ad514566ec69992, b_8ad514566ec69992.words, 79, d_8ad514566ec69992, m_8ad514566ec69992,
|
||||
1, 4, i_8ad514566ec69992, nullptr, nullptr, { &s_8ad514566ec69992, nullptr, nullptr, 0, 0, nullptr }, false
|
||||
};
|
||||
#endif // !CAPNP_LITE
|
||||
static const ::capnp::_::AlignedData<38> b_ba39d45a51b9e73b = {
|
||||
{ 0, 0, 0, 0, 5, 0, 6, 0,
|
||||
59, 231, 185, 81, 90, 212, 57, 186,
|
||||
17, 0, 0, 0, 1, 0, 0, 0,
|
||||
55, 226, 130, 50, 37, 72, 69, 156,
|
||||
1, 0, 7, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
21, 0, 0, 0, 50, 1, 0, 0,
|
||||
37, 0, 0, 0, 7, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
33, 0, 0, 0, 63, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
114, 101, 112, 101, 116, 105, 116, 105,
|
||||
111, 110, 46, 99, 97, 112, 110, 112,
|
||||
58, 69, 110, 117, 109, 101, 114, 97,
|
||||
116, 101, 100, 82, 101, 112, 101, 116,
|
||||
105, 116, 105, 111, 110, 0, 0, 0,
|
||||
0, 0, 0, 0, 1, 0, 1, 0,
|
||||
4, 0, 0, 0, 3, 0, 4, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 1, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
13, 0, 0, 0, 58, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
8, 0, 0, 0, 3, 0, 1, 0,
|
||||
36, 0, 0, 0, 2, 0, 1, 0,
|
||||
100, 101, 108, 116, 97, 115, 0, 0,
|
||||
14, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 3, 0, 1, 0,
|
||||
16, 0, 0, 0, 0, 0, 0, 0,
|
||||
169, 23, 16, 131, 13, 157, 234, 195,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
14, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, }
|
||||
};
|
||||
::capnp::word const* const bp_ba39d45a51b9e73b = b_ba39d45a51b9e73b.words;
|
||||
#if !CAPNP_LITE
|
||||
static const ::capnp::_::RawSchema* const d_ba39d45a51b9e73b[] = {
|
||||
&s_c3ea9d0d831017a9,
|
||||
};
|
||||
static const uint16_t m_ba39d45a51b9e73b[] = {0};
|
||||
static const uint16_t i_ba39d45a51b9e73b[] = {0};
|
||||
const ::capnp::_::RawSchema s_ba39d45a51b9e73b = {
|
||||
0xba39d45a51b9e73b, b_ba39d45a51b9e73b.words, 38, d_ba39d45a51b9e73b, m_ba39d45a51b9e73b,
|
||||
1, 1, i_ba39d45a51b9e73b, nullptr, nullptr, { &s_ba39d45a51b9e73b, nullptr, nullptr, 0, 0, nullptr }, false
|
||||
};
|
||||
#endif // !CAPNP_LITE
|
||||
static const ::capnp::_::AlignedData<26> b_927c0face2bd19e7 = {
|
||||
{ 0, 0, 0, 0, 5, 0, 6, 0,
|
||||
231, 25, 189, 226, 172, 15, 124, 146,
|
||||
17, 0, 0, 0, 1, 0, 1, 0,
|
||||
55, 226, 130, 50, 37, 72, 69, 156,
|
||||
1, 0, 7, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
21, 0, 0, 0, 226, 0, 0, 0,
|
||||
33, 0, 0, 0, 7, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
29, 0, 0, 0, 63, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
114, 101, 112, 101, 116, 105, 116, 105,
|
||||
111, 110, 46, 99, 97, 112, 110, 112,
|
||||
58, 82, 101, 112, 101, 116, 105, 116,
|
||||
105, 111, 110, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 1, 0, 1, 0,
|
||||
4, 0, 0, 0, 3, 0, 4, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
1, 0, 0, 0, 0, 0, 0, 0,
|
||||
221, 231, 117, 117, 81, 203, 55, 148,
|
||||
13, 0, 0, 0, 50, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
116, 121, 112, 101, 115, 0, 0, 0, }
|
||||
};
|
||||
::capnp::word const* const bp_927c0face2bd19e7 = b_927c0face2bd19e7.words;
|
||||
#if !CAPNP_LITE
|
||||
static const ::capnp::_::RawSchema* const d_927c0face2bd19e7[] = {
|
||||
&s_9437cb517575e7dd,
|
||||
};
|
||||
static const uint16_t m_927c0face2bd19e7[] = {0};
|
||||
static const uint16_t i_927c0face2bd19e7[] = {0};
|
||||
const ::capnp::_::RawSchema s_927c0face2bd19e7 = {
|
||||
0x927c0face2bd19e7, b_927c0face2bd19e7.words, 26, d_927c0face2bd19e7, m_927c0face2bd19e7,
|
||||
1, 1, i_927c0face2bd19e7, nullptr, nullptr, { &s_927c0face2bd19e7, nullptr, nullptr, 0, 0, nullptr }, false
|
||||
};
|
||||
#endif // !CAPNP_LITE
|
||||
static const ::capnp::_::AlignedData<80> b_9437cb517575e7dd = {
|
||||
{ 0, 0, 0, 0, 5, 0, 6, 0,
|
||||
221, 231, 117, 117, 81, 203, 55, 148,
|
||||
28, 0, 0, 0, 1, 0, 1, 0,
|
||||
231, 25, 189, 226, 172, 15, 124, 146,
|
||||
1, 0, 7, 0, 1, 0, 4, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
21, 0, 0, 0, 18, 1, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
29, 0, 0, 0, 231, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
114, 101, 112, 101, 116, 105, 116, 105,
|
||||
111, 110, 46, 99, 97, 112, 110, 112,
|
||||
58, 82, 101, 112, 101, 116, 105, 116,
|
||||
105, 111, 110, 46, 116, 121, 112, 101,
|
||||
115, 0, 0, 0, 0, 0, 0, 0,
|
||||
16, 0, 0, 0, 3, 0, 4, 0,
|
||||
0, 0, 255, 255, 0, 0, 0, 0,
|
||||
0, 0, 1, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
97, 0, 0, 0, 58, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
92, 0, 0, 0, 3, 0, 1, 0,
|
||||
104, 0, 0, 0, 2, 0, 1, 0,
|
||||
1, 0, 254, 255, 0, 0, 0, 0,
|
||||
0, 0, 1, 0, 1, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
101, 0, 0, 0, 66, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
96, 0, 0, 0, 3, 0, 1, 0,
|
||||
108, 0, 0, 0, 2, 0, 1, 0,
|
||||
2, 0, 253, 255, 0, 0, 0, 0,
|
||||
0, 0, 1, 0, 2, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
105, 0, 0, 0, 106, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
104, 0, 0, 0, 3, 0, 1, 0,
|
||||
116, 0, 0, 0, 2, 0, 1, 0,
|
||||
3, 0, 252, 255, 0, 0, 0, 0,
|
||||
0, 0, 1, 0, 3, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
113, 0, 0, 0, 90, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
112, 0, 0, 0, 3, 0, 1, 0,
|
||||
124, 0, 0, 0, 2, 0, 1, 0,
|
||||
115, 105, 110, 103, 108, 101, 0, 0,
|
||||
16, 0, 0, 0, 0, 0, 0, 0,
|
||||
169, 23, 16, 131, 13, 157, 234, 195,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
16, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
114, 101, 103, 117, 108, 97, 114, 0,
|
||||
16, 0, 0, 0, 0, 0, 0, 0,
|
||||
146, 153, 198, 110, 86, 20, 213, 138,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
16, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
114, 101, 103, 117, 108, 97, 114, 79,
|
||||
114, 116, 104, 111, 0, 0, 0, 0,
|
||||
16, 0, 0, 0, 0, 0, 0, 0,
|
||||
110, 193, 144, 91, 204, 174, 37, 148,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
16, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
101, 110, 117, 109, 101, 114, 97, 116,
|
||||
101, 100, 0, 0, 0, 0, 0, 0,
|
||||
16, 0, 0, 0, 0, 0, 0, 0,
|
||||
59, 231, 185, 81, 90, 212, 57, 186,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
16, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, }
|
||||
};
|
||||
::capnp::word const* const bp_9437cb517575e7dd = b_9437cb517575e7dd.words;
|
||||
#if !CAPNP_LITE
|
||||
static const ::capnp::_::RawSchema* const d_9437cb517575e7dd[] = {
|
||||
&s_8ad514566ec69992,
|
||||
&s_927c0face2bd19e7,
|
||||
&s_9425aecc5b90c16e,
|
||||
&s_ba39d45a51b9e73b,
|
||||
&s_c3ea9d0d831017a9,
|
||||
};
|
||||
static const uint16_t m_9437cb517575e7dd[] = {3, 1, 2, 0};
|
||||
static const uint16_t i_9437cb517575e7dd[] = {0, 1, 2, 3};
|
||||
const ::capnp::_::RawSchema s_9437cb517575e7dd = {
|
||||
0x9437cb517575e7dd, b_9437cb517575e7dd.words, 80, d_9437cb517575e7dd, m_9437cb517575e7dd,
|
||||
5, 4, i_9437cb517575e7dd, nullptr, nullptr, { &s_9437cb517575e7dd, nullptr, nullptr, 0, 0, nullptr }, false
|
||||
};
|
||||
#endif // !CAPNP_LITE
|
||||
} // namespace schemas
|
||||
} // namespace capnp
|
||||
|
||||
// =======================================================================================
|
||||
|
||||
namespace stream {
|
||||
namespace repetition {
|
||||
|
||||
// RegularOrthoRepetition
|
||||
#if CAPNP_NEED_REDUNDANT_CONSTEXPR_DECL
|
||||
constexpr uint16_t RegularOrthoRepetition::_capnpPrivate::dataWordSize;
|
||||
constexpr uint16_t RegularOrthoRepetition::_capnpPrivate::pointerCount;
|
||||
#endif // !CAPNP_NEED_REDUNDANT_CONSTEXPR_DECL
|
||||
#if !CAPNP_LITE
|
||||
#if CAPNP_NEED_REDUNDANT_CONSTEXPR_DECL
|
||||
constexpr ::capnp::Kind RegularOrthoRepetition::_capnpPrivate::kind;
|
||||
constexpr ::capnp::_::RawSchema const* RegularOrthoRepetition::_capnpPrivate::schema;
|
||||
#endif // !CAPNP_NEED_REDUNDANT_CONSTEXPR_DECL
|
||||
#endif // !CAPNP_LITE
|
||||
|
||||
// RegularRepetition
|
||||
#if CAPNP_NEED_REDUNDANT_CONSTEXPR_DECL
|
||||
constexpr uint16_t RegularRepetition::_capnpPrivate::dataWordSize;
|
||||
constexpr uint16_t RegularRepetition::_capnpPrivate::pointerCount;
|
||||
#endif // !CAPNP_NEED_REDUNDANT_CONSTEXPR_DECL
|
||||
#if !CAPNP_LITE
|
||||
#if CAPNP_NEED_REDUNDANT_CONSTEXPR_DECL
|
||||
constexpr ::capnp::Kind RegularRepetition::_capnpPrivate::kind;
|
||||
constexpr ::capnp::_::RawSchema const* RegularRepetition::_capnpPrivate::schema;
|
||||
#endif // !CAPNP_NEED_REDUNDANT_CONSTEXPR_DECL
|
||||
#endif // !CAPNP_LITE
|
||||
|
||||
// EnumeratedRepetition
|
||||
#if CAPNP_NEED_REDUNDANT_CONSTEXPR_DECL
|
||||
constexpr uint16_t EnumeratedRepetition::_capnpPrivate::dataWordSize;
|
||||
constexpr uint16_t EnumeratedRepetition::_capnpPrivate::pointerCount;
|
||||
#endif // !CAPNP_NEED_REDUNDANT_CONSTEXPR_DECL
|
||||
#if !CAPNP_LITE
|
||||
#if CAPNP_NEED_REDUNDANT_CONSTEXPR_DECL
|
||||
constexpr ::capnp::Kind EnumeratedRepetition::_capnpPrivate::kind;
|
||||
constexpr ::capnp::_::RawSchema const* EnumeratedRepetition::_capnpPrivate::schema;
|
||||
#endif // !CAPNP_NEED_REDUNDANT_CONSTEXPR_DECL
|
||||
#endif // !CAPNP_LITE
|
||||
|
||||
// Repetition
|
||||
#if CAPNP_NEED_REDUNDANT_CONSTEXPR_DECL
|
||||
constexpr uint16_t Repetition::_capnpPrivate::dataWordSize;
|
||||
constexpr uint16_t Repetition::_capnpPrivate::pointerCount;
|
||||
#endif // !CAPNP_NEED_REDUNDANT_CONSTEXPR_DECL
|
||||
#if !CAPNP_LITE
|
||||
#if CAPNP_NEED_REDUNDANT_CONSTEXPR_DECL
|
||||
constexpr ::capnp::Kind Repetition::_capnpPrivate::kind;
|
||||
constexpr ::capnp::_::RawSchema const* Repetition::_capnpPrivate::schema;
|
||||
#endif // !CAPNP_NEED_REDUNDANT_CONSTEXPR_DECL
|
||||
#endif // !CAPNP_LITE
|
||||
|
||||
// Repetition::Types
|
||||
#if CAPNP_NEED_REDUNDANT_CONSTEXPR_DECL
|
||||
constexpr uint16_t Repetition::Types::_capnpPrivate::dataWordSize;
|
||||
constexpr uint16_t Repetition::Types::_capnpPrivate::pointerCount;
|
||||
#endif // !CAPNP_NEED_REDUNDANT_CONSTEXPR_DECL
|
||||
#if !CAPNP_LITE
|
||||
#if CAPNP_NEED_REDUNDANT_CONSTEXPR_DECL
|
||||
constexpr ::capnp::Kind Repetition::Types::_capnpPrivate::kind;
|
||||
constexpr ::capnp::_::RawSchema const* Repetition::Types::_capnpPrivate::schema;
|
||||
#endif // !CAPNP_NEED_REDUNDANT_CONSTEXPR_DECL
|
||||
#endif // !CAPNP_LITE
|
||||
|
||||
|
||||
} // namespace
|
||||
} // namespace
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
|
|
@ -0,0 +1,331 @@
|
|||
// Generated by Cap'n Proto compiler, DO NOT EDIT
|
||||
// source: variant.capnp
|
||||
|
||||
#include "variant.capnp.h"
|
||||
|
||||
namespace capnp {
|
||||
namespace schemas {
|
||||
static const ::capnp::_::AlignedData<48> b_dcf203025f9c6db8 = {
|
||||
{ 0, 0, 0, 0, 5, 0, 6, 0,
|
||||
184, 109, 156, 95, 2, 3, 242, 220,
|
||||
14, 0, 0, 0, 1, 0, 0, 0,
|
||||
66, 164, 246, 229, 82, 216, 227, 146,
|
||||
2, 0, 7, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
21, 0, 0, 0, 202, 0, 0, 0,
|
||||
33, 0, 0, 0, 7, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
29, 0, 0, 0, 119, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
118, 97, 114, 105, 97, 110, 116, 46,
|
||||
99, 97, 112, 110, 112, 58, 65, 114,
|
||||
114, 97, 121, 69, 110, 116, 114, 121,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 1, 0, 1, 0,
|
||||
8, 0, 0, 0, 3, 0, 4, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 1, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
41, 0, 0, 0, 34, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
36, 0, 0, 0, 3, 0, 1, 0,
|
||||
48, 0, 0, 0, 2, 0, 1, 0,
|
||||
1, 0, 0, 0, 1, 0, 0, 0,
|
||||
0, 0, 1, 0, 1, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
45, 0, 0, 0, 50, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
40, 0, 0, 0, 3, 0, 1, 0,
|
||||
52, 0, 0, 0, 2, 0, 1, 0,
|
||||
107, 101, 121, 0, 0, 0, 0, 0,
|
||||
16, 0, 0, 0, 0, 0, 0, 0,
|
||||
198, 25, 189, 174, 235, 112, 106, 249,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
16, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
118, 97, 108, 117, 101, 0, 0, 0,
|
||||
16, 0, 0, 0, 0, 0, 0, 0,
|
||||
198, 25, 189, 174, 235, 112, 106, 249,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
16, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, }
|
||||
};
|
||||
::capnp::word const* const bp_dcf203025f9c6db8 = b_dcf203025f9c6db8.words;
|
||||
#if !CAPNP_LITE
|
||||
static const ::capnp::_::RawSchema* const d_dcf203025f9c6db8[] = {
|
||||
&s_f96a70ebaebd19c6,
|
||||
};
|
||||
static const uint16_t m_dcf203025f9c6db8[] = {0, 1};
|
||||
static const uint16_t i_dcf203025f9c6db8[] = {0, 1};
|
||||
const ::capnp::_::RawSchema s_dcf203025f9c6db8 = {
|
||||
0xdcf203025f9c6db8, b_dcf203025f9c6db8.words, 48, d_dcf203025f9c6db8, m_dcf203025f9c6db8,
|
||||
1, 2, i_dcf203025f9c6db8, nullptr, nullptr, { &s_dcf203025f9c6db8, nullptr, nullptr, 0, 0, nullptr }, false
|
||||
};
|
||||
#endif // !CAPNP_LITE
|
||||
static const ::capnp::_::AlignedData<25> b_f96a70ebaebd19c6 = {
|
||||
{ 0, 0, 0, 0, 5, 0, 6, 0,
|
||||
198, 25, 189, 174, 235, 112, 106, 249,
|
||||
14, 0, 0, 0, 1, 0, 2, 0,
|
||||
66, 164, 246, 229, 82, 216, 227, 146,
|
||||
1, 0, 7, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
21, 0, 0, 0, 178, 0, 0, 0,
|
||||
29, 0, 0, 0, 7, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
25, 0, 0, 0, 63, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
118, 97, 114, 105, 97, 110, 116, 46,
|
||||
99, 97, 112, 110, 112, 58, 86, 97,
|
||||
114, 105, 97, 110, 116, 0, 0, 0,
|
||||
0, 0, 0, 0, 1, 0, 1, 0,
|
||||
4, 0, 0, 0, 3, 0, 4, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
1, 0, 0, 0, 0, 0, 0, 0,
|
||||
160, 103, 140, 31, 120, 18, 4, 135,
|
||||
13, 0, 0, 0, 50, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
118, 97, 108, 117, 101, 0, 0, 0, }
|
||||
};
|
||||
::capnp::word const* const bp_f96a70ebaebd19c6 = b_f96a70ebaebd19c6.words;
|
||||
#if !CAPNP_LITE
|
||||
static const ::capnp::_::RawSchema* const d_f96a70ebaebd19c6[] = {
|
||||
&s_870412781f8c67a0,
|
||||
};
|
||||
static const uint16_t m_f96a70ebaebd19c6[] = {0};
|
||||
static const uint16_t i_f96a70ebaebd19c6[] = {0};
|
||||
const ::capnp::_::RawSchema s_f96a70ebaebd19c6 = {
|
||||
0xf96a70ebaebd19c6, b_f96a70ebaebd19c6.words, 25, d_f96a70ebaebd19c6, m_f96a70ebaebd19c6,
|
||||
1, 1, i_f96a70ebaebd19c6, nullptr, nullptr, { &s_f96a70ebaebd19c6, nullptr, nullptr, 0, 0, nullptr }, false
|
||||
};
|
||||
#endif // !CAPNP_LITE
|
||||
static const ::capnp::_::AlignedData<160> b_870412781f8c67a0 = {
|
||||
{ 0, 0, 0, 0, 5, 0, 6, 0,
|
||||
160, 103, 140, 31, 120, 18, 4, 135,
|
||||
22, 0, 0, 0, 1, 0, 2, 0,
|
||||
198, 25, 189, 174, 235, 112, 106, 249,
|
||||
1, 0, 7, 0, 1, 0, 9, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
21, 0, 0, 0, 226, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
25, 0, 0, 0, 255, 1, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
118, 97, 114, 105, 97, 110, 116, 46,
|
||||
99, 97, 112, 110, 112, 58, 86, 97,
|
||||
114, 105, 97, 110, 116, 46, 118, 97,
|
||||
108, 117, 101, 0, 0, 0, 0, 0,
|
||||
36, 0, 0, 0, 3, 0, 4, 0,
|
||||
0, 0, 255, 255, 0, 0, 0, 0,
|
||||
0, 0, 1, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
237, 0, 0, 0, 34, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
232, 0, 0, 0, 3, 0, 1, 0,
|
||||
244, 0, 0, 0, 2, 0, 1, 0,
|
||||
1, 0, 254, 255, 16, 0, 0, 0,
|
||||
0, 0, 1, 0, 1, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
241, 0, 0, 0, 42, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
236, 0, 0, 0, 3, 0, 1, 0,
|
||||
248, 0, 0, 0, 2, 0, 1, 0,
|
||||
2, 0, 253, 255, 1, 0, 0, 0,
|
||||
0, 0, 1, 0, 2, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
245, 0, 0, 0, 58, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
240, 0, 0, 0, 3, 0, 1, 0,
|
||||
252, 0, 0, 0, 2, 0, 1, 0,
|
||||
3, 0, 252, 255, 1, 0, 0, 0,
|
||||
0, 0, 1, 0, 3, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
249, 0, 0, 0, 50, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
244, 0, 0, 0, 3, 0, 1, 0,
|
||||
0, 1, 0, 0, 2, 0, 1, 0,
|
||||
4, 0, 251, 255, 1, 0, 0, 0,
|
||||
0, 0, 1, 0, 4, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
253, 0, 0, 0, 58, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
248, 0, 0, 0, 3, 0, 1, 0,
|
||||
4, 1, 0, 0, 2, 0, 1, 0,
|
||||
5, 0, 250, 255, 0, 0, 0, 0,
|
||||
0, 0, 1, 0, 5, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
1, 1, 0, 0, 42, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
252, 0, 0, 0, 3, 0, 1, 0,
|
||||
8, 1, 0, 0, 2, 0, 1, 0,
|
||||
6, 0, 249, 255, 0, 0, 0, 0,
|
||||
0, 0, 1, 0, 6, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
5, 1, 0, 0, 42, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 1, 0, 0, 3, 0, 1, 0,
|
||||
28, 1, 0, 0, 2, 0, 1, 0,
|
||||
7, 0, 248, 255, 0, 0, 0, 0,
|
||||
0, 0, 1, 0, 7, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
25, 1, 0, 0, 50, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
20, 1, 0, 0, 3, 0, 1, 0,
|
||||
48, 1, 0, 0, 2, 0, 1, 0,
|
||||
8, 0, 247, 255, 0, 0, 0, 0,
|
||||
0, 0, 1, 0, 8, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
45, 1, 0, 0, 58, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
40, 1, 0, 0, 3, 0, 1, 0,
|
||||
52, 1, 0, 0, 2, 0, 1, 0,
|
||||
110, 105, 108, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
98, 111, 111, 108, 0, 0, 0, 0,
|
||||
1, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
1, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
117, 105, 110, 116, 54, 52, 0, 0,
|
||||
9, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
9, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
105, 110, 116, 54, 52, 0, 0, 0,
|
||||
5, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
5, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
100, 111, 117, 98, 108, 101, 0, 0,
|
||||
11, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
11, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
116, 101, 120, 116, 0, 0, 0, 0,
|
||||
12, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
12, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
108, 105, 115, 116, 0, 0, 0, 0,
|
||||
14, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 3, 0, 1, 0,
|
||||
16, 0, 0, 0, 0, 0, 0, 0,
|
||||
198, 25, 189, 174, 235, 112, 106, 249,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
14, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
97, 114, 114, 97, 121, 0, 0, 0,
|
||||
14, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 3, 0, 1, 0,
|
||||
16, 0, 0, 0, 0, 0, 0, 0,
|
||||
184, 109, 156, 95, 2, 3, 242, 220,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
14, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
111, 98, 106, 101, 99, 116, 0, 0,
|
||||
12, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
12, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, }
|
||||
};
|
||||
::capnp::word const* const bp_870412781f8c67a0 = b_870412781f8c67a0.words;
|
||||
#if !CAPNP_LITE
|
||||
static const ::capnp::_::RawSchema* const d_870412781f8c67a0[] = {
|
||||
&s_dcf203025f9c6db8,
|
||||
&s_f96a70ebaebd19c6,
|
||||
};
|
||||
static const uint16_t m_870412781f8c67a0[] = {7, 1, 4, 3, 6, 0, 8, 5, 2};
|
||||
static const uint16_t i_870412781f8c67a0[] = {0, 1, 2, 3, 4, 5, 6, 7, 8};
|
||||
const ::capnp::_::RawSchema s_870412781f8c67a0 = {
|
||||
0x870412781f8c67a0, b_870412781f8c67a0.words, 160, d_870412781f8c67a0, m_870412781f8c67a0,
|
||||
2, 9, i_870412781f8c67a0, nullptr, nullptr, { &s_870412781f8c67a0, nullptr, nullptr, 0, 0, nullptr }, false
|
||||
};
|
||||
#endif // !CAPNP_LITE
|
||||
} // namespace schemas
|
||||
} // namespace capnp
|
||||
|
||||
// =======================================================================================
|
||||
|
||||
namespace stream {
|
||||
namespace variant {
|
||||
|
||||
// ArrayEntry
|
||||
#if CAPNP_NEED_REDUNDANT_CONSTEXPR_DECL
|
||||
constexpr uint16_t ArrayEntry::_capnpPrivate::dataWordSize;
|
||||
constexpr uint16_t ArrayEntry::_capnpPrivate::pointerCount;
|
||||
#endif // !CAPNP_NEED_REDUNDANT_CONSTEXPR_DECL
|
||||
#if !CAPNP_LITE
|
||||
#if CAPNP_NEED_REDUNDANT_CONSTEXPR_DECL
|
||||
constexpr ::capnp::Kind ArrayEntry::_capnpPrivate::kind;
|
||||
constexpr ::capnp::_::RawSchema const* ArrayEntry::_capnpPrivate::schema;
|
||||
#endif // !CAPNP_NEED_REDUNDANT_CONSTEXPR_DECL
|
||||
#endif // !CAPNP_LITE
|
||||
|
||||
// Variant
|
||||
#if CAPNP_NEED_REDUNDANT_CONSTEXPR_DECL
|
||||
constexpr uint16_t Variant::_capnpPrivate::dataWordSize;
|
||||
constexpr uint16_t Variant::_capnpPrivate::pointerCount;
|
||||
#endif // !CAPNP_NEED_REDUNDANT_CONSTEXPR_DECL
|
||||
#if !CAPNP_LITE
|
||||
#if CAPNP_NEED_REDUNDANT_CONSTEXPR_DECL
|
||||
constexpr ::capnp::Kind Variant::_capnpPrivate::kind;
|
||||
constexpr ::capnp::_::RawSchema const* Variant::_capnpPrivate::schema;
|
||||
#endif // !CAPNP_NEED_REDUNDANT_CONSTEXPR_DECL
|
||||
#endif // !CAPNP_LITE
|
||||
|
||||
// Variant::Value
|
||||
#if CAPNP_NEED_REDUNDANT_CONSTEXPR_DECL
|
||||
constexpr uint16_t Variant::Value::_capnpPrivate::dataWordSize;
|
||||
constexpr uint16_t Variant::Value::_capnpPrivate::pointerCount;
|
||||
#endif // !CAPNP_NEED_REDUNDANT_CONSTEXPR_DECL
|
||||
#if !CAPNP_LITE
|
||||
#if CAPNP_NEED_REDUNDANT_CONSTEXPR_DECL
|
||||
constexpr ::capnp::Kind Variant::Value::_capnpPrivate::kind;
|
||||
constexpr ::capnp::_::RawSchema const* Variant::Value::_capnpPrivate::schema;
|
||||
#endif // !CAPNP_NEED_REDUNDANT_CONSTEXPR_DECL
|
||||
#endif // !CAPNP_LITE
|
||||
|
||||
|
||||
} // namespace
|
||||
} // namespace
|
||||
|
||||
|
|
@ -0,0 +1,873 @@
|
|||
// Generated by Cap'n Proto compiler, DO NOT EDIT
|
||||
// source: variant.capnp
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <capnp/generated-header-support.h>
|
||||
#include <kj/windows-sanity.h>
|
||||
|
||||
#ifndef CAPNP_VERSION
|
||||
#error "CAPNP_VERSION is not defined, is capnp/generated-header-support.h missing?"
|
||||
#elif CAPNP_VERSION != 1000001
|
||||
#error "Version mismatch between generated code and library headers. You must use the same version of the Cap'n Proto compiler and library."
|
||||
#endif
|
||||
|
||||
|
||||
CAPNP_BEGIN_HEADER
|
||||
|
||||
namespace capnp {
|
||||
namespace schemas {
|
||||
|
||||
CAPNP_DECLARE_SCHEMA(dcf203025f9c6db8);
|
||||
CAPNP_DECLARE_SCHEMA(f96a70ebaebd19c6);
|
||||
CAPNP_DECLARE_SCHEMA(870412781f8c67a0);
|
||||
|
||||
} // namespace schemas
|
||||
} // namespace capnp
|
||||
|
||||
namespace stream {
|
||||
namespace variant {
|
||||
|
||||
struct ArrayEntry {
|
||||
ArrayEntry() = delete;
|
||||
|
||||
class Reader;
|
||||
class Builder;
|
||||
class Pipeline;
|
||||
|
||||
struct _capnpPrivate {
|
||||
CAPNP_DECLARE_STRUCT_HEADER(dcf203025f9c6db8, 0, 2)
|
||||
#if !CAPNP_LITE
|
||||
static constexpr ::capnp::_::RawBrandedSchema const* brand() { return &schema->defaultBrand; }
|
||||
#endif // !CAPNP_LITE
|
||||
};
|
||||
};
|
||||
|
||||
struct Variant {
|
||||
Variant() = delete;
|
||||
|
||||
class Reader;
|
||||
class Builder;
|
||||
class Pipeline;
|
||||
struct Value;
|
||||
|
||||
struct _capnpPrivate {
|
||||
CAPNP_DECLARE_STRUCT_HEADER(f96a70ebaebd19c6, 2, 1)
|
||||
#if !CAPNP_LITE
|
||||
static constexpr ::capnp::_::RawBrandedSchema const* brand() { return &schema->defaultBrand; }
|
||||
#endif // !CAPNP_LITE
|
||||
};
|
||||
};
|
||||
|
||||
struct Variant::Value {
|
||||
Value() = delete;
|
||||
|
||||
class Reader;
|
||||
class Builder;
|
||||
class Pipeline;
|
||||
enum Which: uint16_t {
|
||||
NIL,
|
||||
BOOL,
|
||||
UINT64,
|
||||
INT64,
|
||||
DOUBLE,
|
||||
TEXT,
|
||||
LIST,
|
||||
ARRAY,
|
||||
OBJECT,
|
||||
};
|
||||
|
||||
struct _capnpPrivate {
|
||||
CAPNP_DECLARE_STRUCT_HEADER(870412781f8c67a0, 2, 1)
|
||||
#if !CAPNP_LITE
|
||||
static constexpr ::capnp::_::RawBrandedSchema const* brand() { return &schema->defaultBrand; }
|
||||
#endif // !CAPNP_LITE
|
||||
};
|
||||
};
|
||||
|
||||
// =======================================================================================
|
||||
|
||||
class ArrayEntry::Reader {
|
||||
public:
|
||||
typedef ArrayEntry Reads;
|
||||
|
||||
Reader() = default;
|
||||
inline explicit Reader(::capnp::_::StructReader base): _reader(base) {}
|
||||
|
||||
inline ::capnp::MessageSize totalSize() const {
|
||||
return _reader.totalSize().asPublic();
|
||||
}
|
||||
|
||||
#if !CAPNP_LITE
|
||||
inline ::kj::StringTree toString() const {
|
||||
return ::capnp::_::structString(_reader, *_capnpPrivate::brand());
|
||||
}
|
||||
#endif // !CAPNP_LITE
|
||||
|
||||
inline bool hasKey() const;
|
||||
inline ::stream::variant::Variant::Reader getKey() const;
|
||||
|
||||
inline bool hasValue() const;
|
||||
inline ::stream::variant::Variant::Reader getValue() const;
|
||||
|
||||
private:
|
||||
::capnp::_::StructReader _reader;
|
||||
template <typename, ::capnp::Kind>
|
||||
friend struct ::capnp::ToDynamic_;
|
||||
template <typename, ::capnp::Kind>
|
||||
friend struct ::capnp::_::PointerHelpers;
|
||||
template <typename, ::capnp::Kind>
|
||||
friend struct ::capnp::List;
|
||||
friend class ::capnp::MessageBuilder;
|
||||
friend class ::capnp::Orphanage;
|
||||
};
|
||||
|
||||
class ArrayEntry::Builder {
|
||||
public:
|
||||
typedef ArrayEntry Builds;
|
||||
|
||||
Builder() = delete; // Deleted to discourage incorrect usage.
|
||||
// You can explicitly initialize to nullptr instead.
|
||||
inline Builder(decltype(nullptr)) {}
|
||||
inline explicit Builder(::capnp::_::StructBuilder base): _builder(base) {}
|
||||
inline operator Reader() const { return Reader(_builder.asReader()); }
|
||||
inline Reader asReader() const { return *this; }
|
||||
|
||||
inline ::capnp::MessageSize totalSize() const { return asReader().totalSize(); }
|
||||
#if !CAPNP_LITE
|
||||
inline ::kj::StringTree toString() const { return asReader().toString(); }
|
||||
#endif // !CAPNP_LITE
|
||||
|
||||
inline bool hasKey();
|
||||
inline ::stream::variant::Variant::Builder getKey();
|
||||
inline void setKey( ::stream::variant::Variant::Reader value);
|
||||
inline ::stream::variant::Variant::Builder initKey();
|
||||
inline void adoptKey(::capnp::Orphan< ::stream::variant::Variant>&& value);
|
||||
inline ::capnp::Orphan< ::stream::variant::Variant> disownKey();
|
||||
|
||||
inline bool hasValue();
|
||||
inline ::stream::variant::Variant::Builder getValue();
|
||||
inline void setValue( ::stream::variant::Variant::Reader value);
|
||||
inline ::stream::variant::Variant::Builder initValue();
|
||||
inline void adoptValue(::capnp::Orphan< ::stream::variant::Variant>&& value);
|
||||
inline ::capnp::Orphan< ::stream::variant::Variant> disownValue();
|
||||
|
||||
private:
|
||||
::capnp::_::StructBuilder _builder;
|
||||
template <typename, ::capnp::Kind>
|
||||
friend struct ::capnp::ToDynamic_;
|
||||
friend class ::capnp::Orphanage;
|
||||
template <typename, ::capnp::Kind>
|
||||
friend struct ::capnp::_::PointerHelpers;
|
||||
};
|
||||
|
||||
#if !CAPNP_LITE
|
||||
class ArrayEntry::Pipeline {
|
||||
public:
|
||||
typedef ArrayEntry Pipelines;
|
||||
|
||||
inline Pipeline(decltype(nullptr)): _typeless(nullptr) {}
|
||||
inline explicit Pipeline(::capnp::AnyPointer::Pipeline&& typeless)
|
||||
: _typeless(kj::mv(typeless)) {}
|
||||
|
||||
inline ::stream::variant::Variant::Pipeline getKey();
|
||||
inline ::stream::variant::Variant::Pipeline getValue();
|
||||
private:
|
||||
::capnp::AnyPointer::Pipeline _typeless;
|
||||
friend class ::capnp::PipelineHook;
|
||||
template <typename, ::capnp::Kind>
|
||||
friend struct ::capnp::ToDynamic_;
|
||||
};
|
||||
#endif // !CAPNP_LITE
|
||||
|
||||
class Variant::Reader {
|
||||
public:
|
||||
typedef Variant Reads;
|
||||
|
||||
Reader() = default;
|
||||
inline explicit Reader(::capnp::_::StructReader base): _reader(base) {}
|
||||
|
||||
inline ::capnp::MessageSize totalSize() const {
|
||||
return _reader.totalSize().asPublic();
|
||||
}
|
||||
|
||||
#if !CAPNP_LITE
|
||||
inline ::kj::StringTree toString() const {
|
||||
return ::capnp::_::structString(_reader, *_capnpPrivate::brand());
|
||||
}
|
||||
#endif // !CAPNP_LITE
|
||||
|
||||
inline typename Value::Reader getValue() const;
|
||||
|
||||
private:
|
||||
::capnp::_::StructReader _reader;
|
||||
template <typename, ::capnp::Kind>
|
||||
friend struct ::capnp::ToDynamic_;
|
||||
template <typename, ::capnp::Kind>
|
||||
friend struct ::capnp::_::PointerHelpers;
|
||||
template <typename, ::capnp::Kind>
|
||||
friend struct ::capnp::List;
|
||||
friend class ::capnp::MessageBuilder;
|
||||
friend class ::capnp::Orphanage;
|
||||
};
|
||||
|
||||
class Variant::Builder {
|
||||
public:
|
||||
typedef Variant Builds;
|
||||
|
||||
Builder() = delete; // Deleted to discourage incorrect usage.
|
||||
// You can explicitly initialize to nullptr instead.
|
||||
inline Builder(decltype(nullptr)) {}
|
||||
inline explicit Builder(::capnp::_::StructBuilder base): _builder(base) {}
|
||||
inline operator Reader() const { return Reader(_builder.asReader()); }
|
||||
inline Reader asReader() const { return *this; }
|
||||
|
||||
inline ::capnp::MessageSize totalSize() const { return asReader().totalSize(); }
|
||||
#if !CAPNP_LITE
|
||||
inline ::kj::StringTree toString() const { return asReader().toString(); }
|
||||
#endif // !CAPNP_LITE
|
||||
|
||||
inline typename Value::Builder getValue();
|
||||
inline typename Value::Builder initValue();
|
||||
|
||||
private:
|
||||
::capnp::_::StructBuilder _builder;
|
||||
template <typename, ::capnp::Kind>
|
||||
friend struct ::capnp::ToDynamic_;
|
||||
friend class ::capnp::Orphanage;
|
||||
template <typename, ::capnp::Kind>
|
||||
friend struct ::capnp::_::PointerHelpers;
|
||||
};
|
||||
|
||||
#if !CAPNP_LITE
|
||||
class Variant::Pipeline {
|
||||
public:
|
||||
typedef Variant Pipelines;
|
||||
|
||||
inline Pipeline(decltype(nullptr)): _typeless(nullptr) {}
|
||||
inline explicit Pipeline(::capnp::AnyPointer::Pipeline&& typeless)
|
||||
: _typeless(kj::mv(typeless)) {}
|
||||
|
||||
inline typename Value::Pipeline getValue();
|
||||
private:
|
||||
::capnp::AnyPointer::Pipeline _typeless;
|
||||
friend class ::capnp::PipelineHook;
|
||||
template <typename, ::capnp::Kind>
|
||||
friend struct ::capnp::ToDynamic_;
|
||||
};
|
||||
#endif // !CAPNP_LITE
|
||||
|
||||
class Variant::Value::Reader {
|
||||
public:
|
||||
typedef Value Reads;
|
||||
|
||||
Reader() = default;
|
||||
inline explicit Reader(::capnp::_::StructReader base): _reader(base) {}
|
||||
|
||||
inline ::capnp::MessageSize totalSize() const {
|
||||
return _reader.totalSize().asPublic();
|
||||
}
|
||||
|
||||
#if !CAPNP_LITE
|
||||
inline ::kj::StringTree toString() const {
|
||||
return ::capnp::_::structString(_reader, *_capnpPrivate::brand());
|
||||
}
|
||||
#endif // !CAPNP_LITE
|
||||
|
||||
inline Which which() const;
|
||||
inline bool isNil() const;
|
||||
inline ::capnp::Void getNil() const;
|
||||
|
||||
inline bool isBool() const;
|
||||
inline bool getBool() const;
|
||||
|
||||
inline bool isUint64() const;
|
||||
inline ::uint64_t getUint64() const;
|
||||
|
||||
inline bool isInt64() const;
|
||||
inline ::int64_t getInt64() const;
|
||||
|
||||
inline bool isDouble() const;
|
||||
inline double getDouble() const;
|
||||
|
||||
inline bool isText() const;
|
||||
inline bool hasText() const;
|
||||
inline ::capnp::Text::Reader getText() const;
|
||||
|
||||
inline bool isList() const;
|
||||
inline bool hasList() const;
|
||||
inline ::capnp::List< ::stream::variant::Variant, ::capnp::Kind::STRUCT>::Reader getList() const;
|
||||
|
||||
inline bool isArray() const;
|
||||
inline bool hasArray() const;
|
||||
inline ::capnp::List< ::stream::variant::ArrayEntry, ::capnp::Kind::STRUCT>::Reader getArray() const;
|
||||
|
||||
inline bool isObject() const;
|
||||
inline bool hasObject() const;
|
||||
inline ::capnp::Text::Reader getObject() const;
|
||||
|
||||
private:
|
||||
::capnp::_::StructReader _reader;
|
||||
template <typename, ::capnp::Kind>
|
||||
friend struct ::capnp::ToDynamic_;
|
||||
template <typename, ::capnp::Kind>
|
||||
friend struct ::capnp::_::PointerHelpers;
|
||||
template <typename, ::capnp::Kind>
|
||||
friend struct ::capnp::List;
|
||||
friend class ::capnp::MessageBuilder;
|
||||
friend class ::capnp::Orphanage;
|
||||
};
|
||||
|
||||
class Variant::Value::Builder {
|
||||
public:
|
||||
typedef Value Builds;
|
||||
|
||||
Builder() = delete; // Deleted to discourage incorrect usage.
|
||||
// You can explicitly initialize to nullptr instead.
|
||||
inline Builder(decltype(nullptr)) {}
|
||||
inline explicit Builder(::capnp::_::StructBuilder base): _builder(base) {}
|
||||
inline operator Reader() const { return Reader(_builder.asReader()); }
|
||||
inline Reader asReader() const { return *this; }
|
||||
|
||||
inline ::capnp::MessageSize totalSize() const { return asReader().totalSize(); }
|
||||
#if !CAPNP_LITE
|
||||
inline ::kj::StringTree toString() const { return asReader().toString(); }
|
||||
#endif // !CAPNP_LITE
|
||||
|
||||
inline Which which();
|
||||
inline bool isNil();
|
||||
inline ::capnp::Void getNil();
|
||||
inline void setNil( ::capnp::Void value = ::capnp::VOID);
|
||||
|
||||
inline bool isBool();
|
||||
inline bool getBool();
|
||||
inline void setBool(bool value);
|
||||
|
||||
inline bool isUint64();
|
||||
inline ::uint64_t getUint64();
|
||||
inline void setUint64( ::uint64_t value);
|
||||
|
||||
inline bool isInt64();
|
||||
inline ::int64_t getInt64();
|
||||
inline void setInt64( ::int64_t value);
|
||||
|
||||
inline bool isDouble();
|
||||
inline double getDouble();
|
||||
inline void setDouble(double value);
|
||||
|
||||
inline bool isText();
|
||||
inline bool hasText();
|
||||
inline ::capnp::Text::Builder getText();
|
||||
inline void setText( ::capnp::Text::Reader value);
|
||||
inline ::capnp::Text::Builder initText(unsigned int size);
|
||||
inline void adoptText(::capnp::Orphan< ::capnp::Text>&& value);
|
||||
inline ::capnp::Orphan< ::capnp::Text> disownText();
|
||||
|
||||
inline bool isList();
|
||||
inline bool hasList();
|
||||
inline ::capnp::List< ::stream::variant::Variant, ::capnp::Kind::STRUCT>::Builder getList();
|
||||
inline void setList( ::capnp::List< ::stream::variant::Variant, ::capnp::Kind::STRUCT>::Reader value);
|
||||
inline ::capnp::List< ::stream::variant::Variant, ::capnp::Kind::STRUCT>::Builder initList(unsigned int size);
|
||||
inline void adoptList(::capnp::Orphan< ::capnp::List< ::stream::variant::Variant, ::capnp::Kind::STRUCT>>&& value);
|
||||
inline ::capnp::Orphan< ::capnp::List< ::stream::variant::Variant, ::capnp::Kind::STRUCT>> disownList();
|
||||
|
||||
inline bool isArray();
|
||||
inline bool hasArray();
|
||||
inline ::capnp::List< ::stream::variant::ArrayEntry, ::capnp::Kind::STRUCT>::Builder getArray();
|
||||
inline void setArray( ::capnp::List< ::stream::variant::ArrayEntry, ::capnp::Kind::STRUCT>::Reader value);
|
||||
inline ::capnp::List< ::stream::variant::ArrayEntry, ::capnp::Kind::STRUCT>::Builder initArray(unsigned int size);
|
||||
inline void adoptArray(::capnp::Orphan< ::capnp::List< ::stream::variant::ArrayEntry, ::capnp::Kind::STRUCT>>&& value);
|
||||
inline ::capnp::Orphan< ::capnp::List< ::stream::variant::ArrayEntry, ::capnp::Kind::STRUCT>> disownArray();
|
||||
|
||||
inline bool isObject();
|
||||
inline bool hasObject();
|
||||
inline ::capnp::Text::Builder getObject();
|
||||
inline void setObject( ::capnp::Text::Reader value);
|
||||
inline ::capnp::Text::Builder initObject(unsigned int size);
|
||||
inline void adoptObject(::capnp::Orphan< ::capnp::Text>&& value);
|
||||
inline ::capnp::Orphan< ::capnp::Text> disownObject();
|
||||
|
||||
private:
|
||||
::capnp::_::StructBuilder _builder;
|
||||
template <typename, ::capnp::Kind>
|
||||
friend struct ::capnp::ToDynamic_;
|
||||
friend class ::capnp::Orphanage;
|
||||
template <typename, ::capnp::Kind>
|
||||
friend struct ::capnp::_::PointerHelpers;
|
||||
};
|
||||
|
||||
#if !CAPNP_LITE
|
||||
class Variant::Value::Pipeline {
|
||||
public:
|
||||
typedef Value Pipelines;
|
||||
|
||||
inline Pipeline(decltype(nullptr)): _typeless(nullptr) {}
|
||||
inline explicit Pipeline(::capnp::AnyPointer::Pipeline&& typeless)
|
||||
: _typeless(kj::mv(typeless)) {}
|
||||
|
||||
private:
|
||||
::capnp::AnyPointer::Pipeline _typeless;
|
||||
friend class ::capnp::PipelineHook;
|
||||
template <typename, ::capnp::Kind>
|
||||
friend struct ::capnp::ToDynamic_;
|
||||
};
|
||||
#endif // !CAPNP_LITE
|
||||
|
||||
// =======================================================================================
|
||||
|
||||
inline bool ArrayEntry::Reader::hasKey() const {
|
||||
return !_reader.getPointerField(
|
||||
::capnp::bounded<0>() * ::capnp::POINTERS).isNull();
|
||||
}
|
||||
inline bool ArrayEntry::Builder::hasKey() {
|
||||
return !_builder.getPointerField(
|
||||
::capnp::bounded<0>() * ::capnp::POINTERS).isNull();
|
||||
}
|
||||
inline ::stream::variant::Variant::Reader ArrayEntry::Reader::getKey() const {
|
||||
return ::capnp::_::PointerHelpers< ::stream::variant::Variant>::get(_reader.getPointerField(
|
||||
::capnp::bounded<0>() * ::capnp::POINTERS));
|
||||
}
|
||||
inline ::stream::variant::Variant::Builder ArrayEntry::Builder::getKey() {
|
||||
return ::capnp::_::PointerHelpers< ::stream::variant::Variant>::get(_builder.getPointerField(
|
||||
::capnp::bounded<0>() * ::capnp::POINTERS));
|
||||
}
|
||||
#if !CAPNP_LITE
|
||||
inline ::stream::variant::Variant::Pipeline ArrayEntry::Pipeline::getKey() {
|
||||
return ::stream::variant::Variant::Pipeline(_typeless.getPointerField(0));
|
||||
}
|
||||
#endif // !CAPNP_LITE
|
||||
inline void ArrayEntry::Builder::setKey( ::stream::variant::Variant::Reader value) {
|
||||
::capnp::_::PointerHelpers< ::stream::variant::Variant>::set(_builder.getPointerField(
|
||||
::capnp::bounded<0>() * ::capnp::POINTERS), value);
|
||||
}
|
||||
inline ::stream::variant::Variant::Builder ArrayEntry::Builder::initKey() {
|
||||
return ::capnp::_::PointerHelpers< ::stream::variant::Variant>::init(_builder.getPointerField(
|
||||
::capnp::bounded<0>() * ::capnp::POINTERS));
|
||||
}
|
||||
inline void ArrayEntry::Builder::adoptKey(
|
||||
::capnp::Orphan< ::stream::variant::Variant>&& value) {
|
||||
::capnp::_::PointerHelpers< ::stream::variant::Variant>::adopt(_builder.getPointerField(
|
||||
::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value));
|
||||
}
|
||||
inline ::capnp::Orphan< ::stream::variant::Variant> ArrayEntry::Builder::disownKey() {
|
||||
return ::capnp::_::PointerHelpers< ::stream::variant::Variant>::disown(_builder.getPointerField(
|
||||
::capnp::bounded<0>() * ::capnp::POINTERS));
|
||||
}
|
||||
|
||||
inline bool ArrayEntry::Reader::hasValue() const {
|
||||
return !_reader.getPointerField(
|
||||
::capnp::bounded<1>() * ::capnp::POINTERS).isNull();
|
||||
}
|
||||
inline bool ArrayEntry::Builder::hasValue() {
|
||||
return !_builder.getPointerField(
|
||||
::capnp::bounded<1>() * ::capnp::POINTERS).isNull();
|
||||
}
|
||||
inline ::stream::variant::Variant::Reader ArrayEntry::Reader::getValue() const {
|
||||
return ::capnp::_::PointerHelpers< ::stream::variant::Variant>::get(_reader.getPointerField(
|
||||
::capnp::bounded<1>() * ::capnp::POINTERS));
|
||||
}
|
||||
inline ::stream::variant::Variant::Builder ArrayEntry::Builder::getValue() {
|
||||
return ::capnp::_::PointerHelpers< ::stream::variant::Variant>::get(_builder.getPointerField(
|
||||
::capnp::bounded<1>() * ::capnp::POINTERS));
|
||||
}
|
||||
#if !CAPNP_LITE
|
||||
inline ::stream::variant::Variant::Pipeline ArrayEntry::Pipeline::getValue() {
|
||||
return ::stream::variant::Variant::Pipeline(_typeless.getPointerField(1));
|
||||
}
|
||||
#endif // !CAPNP_LITE
|
||||
inline void ArrayEntry::Builder::setValue( ::stream::variant::Variant::Reader value) {
|
||||
::capnp::_::PointerHelpers< ::stream::variant::Variant>::set(_builder.getPointerField(
|
||||
::capnp::bounded<1>() * ::capnp::POINTERS), value);
|
||||
}
|
||||
inline ::stream::variant::Variant::Builder ArrayEntry::Builder::initValue() {
|
||||
return ::capnp::_::PointerHelpers< ::stream::variant::Variant>::init(_builder.getPointerField(
|
||||
::capnp::bounded<1>() * ::capnp::POINTERS));
|
||||
}
|
||||
inline void ArrayEntry::Builder::adoptValue(
|
||||
::capnp::Orphan< ::stream::variant::Variant>&& value) {
|
||||
::capnp::_::PointerHelpers< ::stream::variant::Variant>::adopt(_builder.getPointerField(
|
||||
::capnp::bounded<1>() * ::capnp::POINTERS), kj::mv(value));
|
||||
}
|
||||
inline ::capnp::Orphan< ::stream::variant::Variant> ArrayEntry::Builder::disownValue() {
|
||||
return ::capnp::_::PointerHelpers< ::stream::variant::Variant>::disown(_builder.getPointerField(
|
||||
::capnp::bounded<1>() * ::capnp::POINTERS));
|
||||
}
|
||||
|
||||
inline typename Variant::Value::Reader Variant::Reader::getValue() const {
|
||||
return typename Variant::Value::Reader(_reader);
|
||||
}
|
||||
inline typename Variant::Value::Builder Variant::Builder::getValue() {
|
||||
return typename Variant::Value::Builder(_builder);
|
||||
}
|
||||
#if !CAPNP_LITE
|
||||
inline typename Variant::Value::Pipeline Variant::Pipeline::getValue() {
|
||||
return typename Variant::Value::Pipeline(_typeless.noop());
|
||||
}
|
||||
#endif // !CAPNP_LITE
|
||||
inline typename Variant::Value::Builder Variant::Builder::initValue() {
|
||||
_builder.setDataField< ::uint16_t>(::capnp::bounded<0>() * ::capnp::ELEMENTS, 0);
|
||||
_builder.setDataField<bool>(::capnp::bounded<16>() * ::capnp::ELEMENTS, 0);
|
||||
_builder.setDataField< ::uint64_t>(::capnp::bounded<1>() * ::capnp::ELEMENTS, 0);
|
||||
_builder.getPointerField(::capnp::bounded<0>() * ::capnp::POINTERS).clear();
|
||||
return typename Variant::Value::Builder(_builder);
|
||||
}
|
||||
inline ::stream::variant::Variant::Value::Which Variant::Value::Reader::which() const {
|
||||
return _reader.getDataField<Which>(
|
||||
::capnp::bounded<0>() * ::capnp::ELEMENTS);
|
||||
}
|
||||
inline ::stream::variant::Variant::Value::Which Variant::Value::Builder::which() {
|
||||
return _builder.getDataField<Which>(
|
||||
::capnp::bounded<0>() * ::capnp::ELEMENTS);
|
||||
}
|
||||
|
||||
inline bool Variant::Value::Reader::isNil() const {
|
||||
return which() == Variant::Value::NIL;
|
||||
}
|
||||
inline bool Variant::Value::Builder::isNil() {
|
||||
return which() == Variant::Value::NIL;
|
||||
}
|
||||
inline ::capnp::Void Variant::Value::Reader::getNil() const {
|
||||
KJ_IREQUIRE((which() == Variant::Value::NIL),
|
||||
"Must check which() before get()ing a union member.");
|
||||
return _reader.getDataField< ::capnp::Void>(
|
||||
::capnp::bounded<0>() * ::capnp::ELEMENTS);
|
||||
}
|
||||
|
||||
inline ::capnp::Void Variant::Value::Builder::getNil() {
|
||||
KJ_IREQUIRE((which() == Variant::Value::NIL),
|
||||
"Must check which() before get()ing a union member.");
|
||||
return _builder.getDataField< ::capnp::Void>(
|
||||
::capnp::bounded<0>() * ::capnp::ELEMENTS);
|
||||
}
|
||||
inline void Variant::Value::Builder::setNil( ::capnp::Void value) {
|
||||
_builder.setDataField<Variant::Value::Which>(
|
||||
::capnp::bounded<0>() * ::capnp::ELEMENTS, Variant::Value::NIL);
|
||||
_builder.setDataField< ::capnp::Void>(
|
||||
::capnp::bounded<0>() * ::capnp::ELEMENTS, value);
|
||||
}
|
||||
|
||||
inline bool Variant::Value::Reader::isBool() const {
|
||||
return which() == Variant::Value::BOOL;
|
||||
}
|
||||
inline bool Variant::Value::Builder::isBool() {
|
||||
return which() == Variant::Value::BOOL;
|
||||
}
|
||||
inline bool Variant::Value::Reader::getBool() const {
|
||||
KJ_IREQUIRE((which() == Variant::Value::BOOL),
|
||||
"Must check which() before get()ing a union member.");
|
||||
return _reader.getDataField<bool>(
|
||||
::capnp::bounded<16>() * ::capnp::ELEMENTS);
|
||||
}
|
||||
|
||||
inline bool Variant::Value::Builder::getBool() {
|
||||
KJ_IREQUIRE((which() == Variant::Value::BOOL),
|
||||
"Must check which() before get()ing a union member.");
|
||||
return _builder.getDataField<bool>(
|
||||
::capnp::bounded<16>() * ::capnp::ELEMENTS);
|
||||
}
|
||||
inline void Variant::Value::Builder::setBool(bool value) {
|
||||
_builder.setDataField<Variant::Value::Which>(
|
||||
::capnp::bounded<0>() * ::capnp::ELEMENTS, Variant::Value::BOOL);
|
||||
_builder.setDataField<bool>(
|
||||
::capnp::bounded<16>() * ::capnp::ELEMENTS, value);
|
||||
}
|
||||
|
||||
inline bool Variant::Value::Reader::isUint64() const {
|
||||
return which() == Variant::Value::UINT64;
|
||||
}
|
||||
inline bool Variant::Value::Builder::isUint64() {
|
||||
return which() == Variant::Value::UINT64;
|
||||
}
|
||||
inline ::uint64_t Variant::Value::Reader::getUint64() const {
|
||||
KJ_IREQUIRE((which() == Variant::Value::UINT64),
|
||||
"Must check which() before get()ing a union member.");
|
||||
return _reader.getDataField< ::uint64_t>(
|
||||
::capnp::bounded<1>() * ::capnp::ELEMENTS);
|
||||
}
|
||||
|
||||
inline ::uint64_t Variant::Value::Builder::getUint64() {
|
||||
KJ_IREQUIRE((which() == Variant::Value::UINT64),
|
||||
"Must check which() before get()ing a union member.");
|
||||
return _builder.getDataField< ::uint64_t>(
|
||||
::capnp::bounded<1>() * ::capnp::ELEMENTS);
|
||||
}
|
||||
inline void Variant::Value::Builder::setUint64( ::uint64_t value) {
|
||||
_builder.setDataField<Variant::Value::Which>(
|
||||
::capnp::bounded<0>() * ::capnp::ELEMENTS, Variant::Value::UINT64);
|
||||
_builder.setDataField< ::uint64_t>(
|
||||
::capnp::bounded<1>() * ::capnp::ELEMENTS, value);
|
||||
}
|
||||
|
||||
inline bool Variant::Value::Reader::isInt64() const {
|
||||
return which() == Variant::Value::INT64;
|
||||
}
|
||||
inline bool Variant::Value::Builder::isInt64() {
|
||||
return which() == Variant::Value::INT64;
|
||||
}
|
||||
inline ::int64_t Variant::Value::Reader::getInt64() const {
|
||||
KJ_IREQUIRE((which() == Variant::Value::INT64),
|
||||
"Must check which() before get()ing a union member.");
|
||||
return _reader.getDataField< ::int64_t>(
|
||||
::capnp::bounded<1>() * ::capnp::ELEMENTS);
|
||||
}
|
||||
|
||||
inline ::int64_t Variant::Value::Builder::getInt64() {
|
||||
KJ_IREQUIRE((which() == Variant::Value::INT64),
|
||||
"Must check which() before get()ing a union member.");
|
||||
return _builder.getDataField< ::int64_t>(
|
||||
::capnp::bounded<1>() * ::capnp::ELEMENTS);
|
||||
}
|
||||
inline void Variant::Value::Builder::setInt64( ::int64_t value) {
|
||||
_builder.setDataField<Variant::Value::Which>(
|
||||
::capnp::bounded<0>() * ::capnp::ELEMENTS, Variant::Value::INT64);
|
||||
_builder.setDataField< ::int64_t>(
|
||||
::capnp::bounded<1>() * ::capnp::ELEMENTS, value);
|
||||
}
|
||||
|
||||
inline bool Variant::Value::Reader::isDouble() const {
|
||||
return which() == Variant::Value::DOUBLE;
|
||||
}
|
||||
inline bool Variant::Value::Builder::isDouble() {
|
||||
return which() == Variant::Value::DOUBLE;
|
||||
}
|
||||
inline double Variant::Value::Reader::getDouble() const {
|
||||
KJ_IREQUIRE((which() == Variant::Value::DOUBLE),
|
||||
"Must check which() before get()ing a union member.");
|
||||
return _reader.getDataField<double>(
|
||||
::capnp::bounded<1>() * ::capnp::ELEMENTS);
|
||||
}
|
||||
|
||||
inline double Variant::Value::Builder::getDouble() {
|
||||
KJ_IREQUIRE((which() == Variant::Value::DOUBLE),
|
||||
"Must check which() before get()ing a union member.");
|
||||
return _builder.getDataField<double>(
|
||||
::capnp::bounded<1>() * ::capnp::ELEMENTS);
|
||||
}
|
||||
inline void Variant::Value::Builder::setDouble(double value) {
|
||||
_builder.setDataField<Variant::Value::Which>(
|
||||
::capnp::bounded<0>() * ::capnp::ELEMENTS, Variant::Value::DOUBLE);
|
||||
_builder.setDataField<double>(
|
||||
::capnp::bounded<1>() * ::capnp::ELEMENTS, value);
|
||||
}
|
||||
|
||||
inline bool Variant::Value::Reader::isText() const {
|
||||
return which() == Variant::Value::TEXT;
|
||||
}
|
||||
inline bool Variant::Value::Builder::isText() {
|
||||
return which() == Variant::Value::TEXT;
|
||||
}
|
||||
inline bool Variant::Value::Reader::hasText() const {
|
||||
if (which() != Variant::Value::TEXT) return false;
|
||||
return !_reader.getPointerField(
|
||||
::capnp::bounded<0>() * ::capnp::POINTERS).isNull();
|
||||
}
|
||||
inline bool Variant::Value::Builder::hasText() {
|
||||
if (which() != Variant::Value::TEXT) return false;
|
||||
return !_builder.getPointerField(
|
||||
::capnp::bounded<0>() * ::capnp::POINTERS).isNull();
|
||||
}
|
||||
inline ::capnp::Text::Reader Variant::Value::Reader::getText() const {
|
||||
KJ_IREQUIRE((which() == Variant::Value::TEXT),
|
||||
"Must check which() before get()ing a union member.");
|
||||
return ::capnp::_::PointerHelpers< ::capnp::Text>::get(_reader.getPointerField(
|
||||
::capnp::bounded<0>() * ::capnp::POINTERS));
|
||||
}
|
||||
inline ::capnp::Text::Builder Variant::Value::Builder::getText() {
|
||||
KJ_IREQUIRE((which() == Variant::Value::TEXT),
|
||||
"Must check which() before get()ing a union member.");
|
||||
return ::capnp::_::PointerHelpers< ::capnp::Text>::get(_builder.getPointerField(
|
||||
::capnp::bounded<0>() * ::capnp::POINTERS));
|
||||
}
|
||||
inline void Variant::Value::Builder::setText( ::capnp::Text::Reader value) {
|
||||
_builder.setDataField<Variant::Value::Which>(
|
||||
::capnp::bounded<0>() * ::capnp::ELEMENTS, Variant::Value::TEXT);
|
||||
::capnp::_::PointerHelpers< ::capnp::Text>::set(_builder.getPointerField(
|
||||
::capnp::bounded<0>() * ::capnp::POINTERS), value);
|
||||
}
|
||||
inline ::capnp::Text::Builder Variant::Value::Builder::initText(unsigned int size) {
|
||||
_builder.setDataField<Variant::Value::Which>(
|
||||
::capnp::bounded<0>() * ::capnp::ELEMENTS, Variant::Value::TEXT);
|
||||
return ::capnp::_::PointerHelpers< ::capnp::Text>::init(_builder.getPointerField(
|
||||
::capnp::bounded<0>() * ::capnp::POINTERS), size);
|
||||
}
|
||||
inline void Variant::Value::Builder::adoptText(
|
||||
::capnp::Orphan< ::capnp::Text>&& value) {
|
||||
_builder.setDataField<Variant::Value::Which>(
|
||||
::capnp::bounded<0>() * ::capnp::ELEMENTS, Variant::Value::TEXT);
|
||||
::capnp::_::PointerHelpers< ::capnp::Text>::adopt(_builder.getPointerField(
|
||||
::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value));
|
||||
}
|
||||
inline ::capnp::Orphan< ::capnp::Text> Variant::Value::Builder::disownText() {
|
||||
KJ_IREQUIRE((which() == Variant::Value::TEXT),
|
||||
"Must check which() before get()ing a union member.");
|
||||
return ::capnp::_::PointerHelpers< ::capnp::Text>::disown(_builder.getPointerField(
|
||||
::capnp::bounded<0>() * ::capnp::POINTERS));
|
||||
}
|
||||
|
||||
inline bool Variant::Value::Reader::isList() const {
|
||||
return which() == Variant::Value::LIST;
|
||||
}
|
||||
inline bool Variant::Value::Builder::isList() {
|
||||
return which() == Variant::Value::LIST;
|
||||
}
|
||||
inline bool Variant::Value::Reader::hasList() const {
|
||||
if (which() != Variant::Value::LIST) return false;
|
||||
return !_reader.getPointerField(
|
||||
::capnp::bounded<0>() * ::capnp::POINTERS).isNull();
|
||||
}
|
||||
inline bool Variant::Value::Builder::hasList() {
|
||||
if (which() != Variant::Value::LIST) return false;
|
||||
return !_builder.getPointerField(
|
||||
::capnp::bounded<0>() * ::capnp::POINTERS).isNull();
|
||||
}
|
||||
inline ::capnp::List< ::stream::variant::Variant, ::capnp::Kind::STRUCT>::Reader Variant::Value::Reader::getList() const {
|
||||
KJ_IREQUIRE((which() == Variant::Value::LIST),
|
||||
"Must check which() before get()ing a union member.");
|
||||
return ::capnp::_::PointerHelpers< ::capnp::List< ::stream::variant::Variant, ::capnp::Kind::STRUCT>>::get(_reader.getPointerField(
|
||||
::capnp::bounded<0>() * ::capnp::POINTERS));
|
||||
}
|
||||
inline ::capnp::List< ::stream::variant::Variant, ::capnp::Kind::STRUCT>::Builder Variant::Value::Builder::getList() {
|
||||
KJ_IREQUIRE((which() == Variant::Value::LIST),
|
||||
"Must check which() before get()ing a union member.");
|
||||
return ::capnp::_::PointerHelpers< ::capnp::List< ::stream::variant::Variant, ::capnp::Kind::STRUCT>>::get(_builder.getPointerField(
|
||||
::capnp::bounded<0>() * ::capnp::POINTERS));
|
||||
}
|
||||
inline void Variant::Value::Builder::setList( ::capnp::List< ::stream::variant::Variant, ::capnp::Kind::STRUCT>::Reader value) {
|
||||
_builder.setDataField<Variant::Value::Which>(
|
||||
::capnp::bounded<0>() * ::capnp::ELEMENTS, Variant::Value::LIST);
|
||||
::capnp::_::PointerHelpers< ::capnp::List< ::stream::variant::Variant, ::capnp::Kind::STRUCT>>::set(_builder.getPointerField(
|
||||
::capnp::bounded<0>() * ::capnp::POINTERS), value);
|
||||
}
|
||||
inline ::capnp::List< ::stream::variant::Variant, ::capnp::Kind::STRUCT>::Builder Variant::Value::Builder::initList(unsigned int size) {
|
||||
_builder.setDataField<Variant::Value::Which>(
|
||||
::capnp::bounded<0>() * ::capnp::ELEMENTS, Variant::Value::LIST);
|
||||
return ::capnp::_::PointerHelpers< ::capnp::List< ::stream::variant::Variant, ::capnp::Kind::STRUCT>>::init(_builder.getPointerField(
|
||||
::capnp::bounded<0>() * ::capnp::POINTERS), size);
|
||||
}
|
||||
inline void Variant::Value::Builder::adoptList(
|
||||
::capnp::Orphan< ::capnp::List< ::stream::variant::Variant, ::capnp::Kind::STRUCT>>&& value) {
|
||||
_builder.setDataField<Variant::Value::Which>(
|
||||
::capnp::bounded<0>() * ::capnp::ELEMENTS, Variant::Value::LIST);
|
||||
::capnp::_::PointerHelpers< ::capnp::List< ::stream::variant::Variant, ::capnp::Kind::STRUCT>>::adopt(_builder.getPointerField(
|
||||
::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value));
|
||||
}
|
||||
inline ::capnp::Orphan< ::capnp::List< ::stream::variant::Variant, ::capnp::Kind::STRUCT>> Variant::Value::Builder::disownList() {
|
||||
KJ_IREQUIRE((which() == Variant::Value::LIST),
|
||||
"Must check which() before get()ing a union member.");
|
||||
return ::capnp::_::PointerHelpers< ::capnp::List< ::stream::variant::Variant, ::capnp::Kind::STRUCT>>::disown(_builder.getPointerField(
|
||||
::capnp::bounded<0>() * ::capnp::POINTERS));
|
||||
}
|
||||
|
||||
inline bool Variant::Value::Reader::isArray() const {
|
||||
return which() == Variant::Value::ARRAY;
|
||||
}
|
||||
inline bool Variant::Value::Builder::isArray() {
|
||||
return which() == Variant::Value::ARRAY;
|
||||
}
|
||||
inline bool Variant::Value::Reader::hasArray() const {
|
||||
if (which() != Variant::Value::ARRAY) return false;
|
||||
return !_reader.getPointerField(
|
||||
::capnp::bounded<0>() * ::capnp::POINTERS).isNull();
|
||||
}
|
||||
inline bool Variant::Value::Builder::hasArray() {
|
||||
if (which() != Variant::Value::ARRAY) return false;
|
||||
return !_builder.getPointerField(
|
||||
::capnp::bounded<0>() * ::capnp::POINTERS).isNull();
|
||||
}
|
||||
inline ::capnp::List< ::stream::variant::ArrayEntry, ::capnp::Kind::STRUCT>::Reader Variant::Value::Reader::getArray() const {
|
||||
KJ_IREQUIRE((which() == Variant::Value::ARRAY),
|
||||
"Must check which() before get()ing a union member.");
|
||||
return ::capnp::_::PointerHelpers< ::capnp::List< ::stream::variant::ArrayEntry, ::capnp::Kind::STRUCT>>::get(_reader.getPointerField(
|
||||
::capnp::bounded<0>() * ::capnp::POINTERS));
|
||||
}
|
||||
inline ::capnp::List< ::stream::variant::ArrayEntry, ::capnp::Kind::STRUCT>::Builder Variant::Value::Builder::getArray() {
|
||||
KJ_IREQUIRE((which() == Variant::Value::ARRAY),
|
||||
"Must check which() before get()ing a union member.");
|
||||
return ::capnp::_::PointerHelpers< ::capnp::List< ::stream::variant::ArrayEntry, ::capnp::Kind::STRUCT>>::get(_builder.getPointerField(
|
||||
::capnp::bounded<0>() * ::capnp::POINTERS));
|
||||
}
|
||||
inline void Variant::Value::Builder::setArray( ::capnp::List< ::stream::variant::ArrayEntry, ::capnp::Kind::STRUCT>::Reader value) {
|
||||
_builder.setDataField<Variant::Value::Which>(
|
||||
::capnp::bounded<0>() * ::capnp::ELEMENTS, Variant::Value::ARRAY);
|
||||
::capnp::_::PointerHelpers< ::capnp::List< ::stream::variant::ArrayEntry, ::capnp::Kind::STRUCT>>::set(_builder.getPointerField(
|
||||
::capnp::bounded<0>() * ::capnp::POINTERS), value);
|
||||
}
|
||||
inline ::capnp::List< ::stream::variant::ArrayEntry, ::capnp::Kind::STRUCT>::Builder Variant::Value::Builder::initArray(unsigned int size) {
|
||||
_builder.setDataField<Variant::Value::Which>(
|
||||
::capnp::bounded<0>() * ::capnp::ELEMENTS, Variant::Value::ARRAY);
|
||||
return ::capnp::_::PointerHelpers< ::capnp::List< ::stream::variant::ArrayEntry, ::capnp::Kind::STRUCT>>::init(_builder.getPointerField(
|
||||
::capnp::bounded<0>() * ::capnp::POINTERS), size);
|
||||
}
|
||||
inline void Variant::Value::Builder::adoptArray(
|
||||
::capnp::Orphan< ::capnp::List< ::stream::variant::ArrayEntry, ::capnp::Kind::STRUCT>>&& value) {
|
||||
_builder.setDataField<Variant::Value::Which>(
|
||||
::capnp::bounded<0>() * ::capnp::ELEMENTS, Variant::Value::ARRAY);
|
||||
::capnp::_::PointerHelpers< ::capnp::List< ::stream::variant::ArrayEntry, ::capnp::Kind::STRUCT>>::adopt(_builder.getPointerField(
|
||||
::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value));
|
||||
}
|
||||
inline ::capnp::Orphan< ::capnp::List< ::stream::variant::ArrayEntry, ::capnp::Kind::STRUCT>> Variant::Value::Builder::disownArray() {
|
||||
KJ_IREQUIRE((which() == Variant::Value::ARRAY),
|
||||
"Must check which() before get()ing a union member.");
|
||||
return ::capnp::_::PointerHelpers< ::capnp::List< ::stream::variant::ArrayEntry, ::capnp::Kind::STRUCT>>::disown(_builder.getPointerField(
|
||||
::capnp::bounded<0>() * ::capnp::POINTERS));
|
||||
}
|
||||
|
||||
inline bool Variant::Value::Reader::isObject() const {
|
||||
return which() == Variant::Value::OBJECT;
|
||||
}
|
||||
inline bool Variant::Value::Builder::isObject() {
|
||||
return which() == Variant::Value::OBJECT;
|
||||
}
|
||||
inline bool Variant::Value::Reader::hasObject() const {
|
||||
if (which() != Variant::Value::OBJECT) return false;
|
||||
return !_reader.getPointerField(
|
||||
::capnp::bounded<0>() * ::capnp::POINTERS).isNull();
|
||||
}
|
||||
inline bool Variant::Value::Builder::hasObject() {
|
||||
if (which() != Variant::Value::OBJECT) return false;
|
||||
return !_builder.getPointerField(
|
||||
::capnp::bounded<0>() * ::capnp::POINTERS).isNull();
|
||||
}
|
||||
inline ::capnp::Text::Reader Variant::Value::Reader::getObject() const {
|
||||
KJ_IREQUIRE((which() == Variant::Value::OBJECT),
|
||||
"Must check which() before get()ing a union member.");
|
||||
return ::capnp::_::PointerHelpers< ::capnp::Text>::get(_reader.getPointerField(
|
||||
::capnp::bounded<0>() * ::capnp::POINTERS));
|
||||
}
|
||||
inline ::capnp::Text::Builder Variant::Value::Builder::getObject() {
|
||||
KJ_IREQUIRE((which() == Variant::Value::OBJECT),
|
||||
"Must check which() before get()ing a union member.");
|
||||
return ::capnp::_::PointerHelpers< ::capnp::Text>::get(_builder.getPointerField(
|
||||
::capnp::bounded<0>() * ::capnp::POINTERS));
|
||||
}
|
||||
inline void Variant::Value::Builder::setObject( ::capnp::Text::Reader value) {
|
||||
_builder.setDataField<Variant::Value::Which>(
|
||||
::capnp::bounded<0>() * ::capnp::ELEMENTS, Variant::Value::OBJECT);
|
||||
::capnp::_::PointerHelpers< ::capnp::Text>::set(_builder.getPointerField(
|
||||
::capnp::bounded<0>() * ::capnp::POINTERS), value);
|
||||
}
|
||||
inline ::capnp::Text::Builder Variant::Value::Builder::initObject(unsigned int size) {
|
||||
_builder.setDataField<Variant::Value::Which>(
|
||||
::capnp::bounded<0>() * ::capnp::ELEMENTS, Variant::Value::OBJECT);
|
||||
return ::capnp::_::PointerHelpers< ::capnp::Text>::init(_builder.getPointerField(
|
||||
::capnp::bounded<0>() * ::capnp::POINTERS), size);
|
||||
}
|
||||
inline void Variant::Value::Builder::adoptObject(
|
||||
::capnp::Orphan< ::capnp::Text>&& value) {
|
||||
_builder.setDataField<Variant::Value::Which>(
|
||||
::capnp::bounded<0>() * ::capnp::ELEMENTS, Variant::Value::OBJECT);
|
||||
::capnp::_::PointerHelpers< ::capnp::Text>::adopt(_builder.getPointerField(
|
||||
::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value));
|
||||
}
|
||||
inline ::capnp::Orphan< ::capnp::Text> Variant::Value::Builder::disownObject() {
|
||||
KJ_IREQUIRE((which() == Variant::Value::OBJECT),
|
||||
"Must check which() before get()ing a union member.");
|
||||
return ::capnp::_::PointerHelpers< ::capnp::Text>::disown(_builder.getPointerField(
|
||||
::capnp::bounded<0>() * ::capnp::POINTERS));
|
||||
}
|
||||
|
||||
} // namespace
|
||||
} // namespace
|
||||
|
||||
CAPNP_END_HEADER
|
||||
|
||||
|
|
@ -0,0 +1,48 @@
|
|||
#!/bin/bash -e
|
||||
|
||||
capnp_version=$(capnp --version)
|
||||
if [ "$capnp_version" != "Cap'n Proto version 1.0.1" ]; then
|
||||
echo "ERROR: needs capnp version 1.0.1, got '$capnp_version'"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
src=(
|
||||
cell.capnp
|
||||
geometry.capnp
|
||||
header.capnp
|
||||
layoutView.capnp
|
||||
library.capnp
|
||||
metaData.capnp
|
||||
metaDataView.capnp
|
||||
propertySet.capnp
|
||||
repetition.capnp
|
||||
variant.capnp
|
||||
)
|
||||
|
||||
srcdir=$(pwd)/capnp_src
|
||||
|
||||
dest=$(pwd)/capnp
|
||||
rm -rf $dest
|
||||
mkdir $dest
|
||||
|
||||
cd $srcdir
|
||||
for f in ${src[@]}; do
|
||||
echo "Compiling $f .."
|
||||
capnp compile -o /usr/bin/capnpc-c++:$dest --src-prefix $dest -I $srcdir $f
|
||||
mv $dest/$f.c++ $dest/$f.cc
|
||||
done
|
||||
|
||||
pri=$dest/capnp.pri
|
||||
echo "" >$pri
|
||||
echo "HEADERS=\\" >>$pri
|
||||
for f in ${src[@]}; do
|
||||
echo " capnp/$f.h \\" >>$pri
|
||||
done
|
||||
echo "" >>$pri
|
||||
|
||||
echo "SOURCES=\\" >>$pri
|
||||
for f in ${src[@]}; do
|
||||
echo " capnp/$f.cc \\" >>$pri
|
||||
done
|
||||
echo "" >>$pri
|
||||
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
@0xbfd8ee64184d5def;
|
||||
|
||||
using Cxx = import "/capnp/c++.capnp";
|
||||
$Cxx.namespace("stream::cell");
|
||||
|
||||
# The Cell header
|
||||
|
||||
struct Cell
|
||||
{
|
||||
# Enumerates the views the cell provides. These are base-0 indexes
|
||||
# into the Library::viewSpecsTable::viewSpecs list. The corresponding
|
||||
# view messages follow this Cell message.
|
||||
#
|
||||
# In KLayout, a cell can have the following views:
|
||||
# "layout": the shapes and instances (LayoutView message)
|
||||
# "metaData": the cell's meta data (MetaDataView message)
|
||||
#
|
||||
# If "layout" is missing, the cell is a "ghost cell" - i.e. one
|
||||
# which does not have a content yet. Such cells are treated specially,
|
||||
# e.g. they do not appear as structures in GDS files.
|
||||
#
|
||||
# "metaData" is an optional view that holds arbitrary meta data
|
||||
# (key/value pairs) per cell.
|
||||
|
||||
viewIds @0 :List(UInt16);
|
||||
}
|
||||
|
||||
# Followed by "viewIds.size" messages with the view data
|
||||
|
||||
|
|
@ -0,0 +1,189 @@
|
|||
@0x814220fba761a890;
|
||||
|
||||
using Cxx = import "/capnp/c++.capnp";
|
||||
$Cxx.namespace("stream::geometry");
|
||||
|
||||
# Enumerates the possible orthogonal fixpoint transformations
|
||||
enum FixPointTransformation {
|
||||
r0 @0; # no rotation
|
||||
r90 @1; # rotation by 90 degree counterclockwise
|
||||
r180 @2; # rotation by 180 degree counterclockwise
|
||||
r270 @3; # rotation by 270 degree counterclockwise
|
||||
m0 @4; # mirror at x axis ("0 degree axis")
|
||||
m45 @5; # mirror at positive x/y diagonal ("45 degree axis")
|
||||
m90 @6; # mirror at y axis ("90 degree axis")
|
||||
m135 @7; # mirror at negative x/y diagonal ("135 degree axis")
|
||||
}
|
||||
|
||||
# Implements a Vector
|
||||
# A vector is a displacement or differences between points.
|
||||
# In contrast to that, a point is a fixed position in 2d space.
|
||||
# Coordinates are always expressed as 64 bit coordinates.
|
||||
struct Vector
|
||||
{
|
||||
dx @0 :Int64;
|
||||
dy @1 :Int64;
|
||||
}
|
||||
|
||||
# A point
|
||||
# A point describes a position. In constrast to the vector,
|
||||
# the position is not the distance between two points.
|
||||
# Coordinates are always expressed as 64 bit coordinates.
|
||||
struct Point
|
||||
{
|
||||
x @0 :Int64;
|
||||
y @1 :Int64;
|
||||
}
|
||||
|
||||
# A rectangle
|
||||
# Rectangles are implemented by a lower-left point and a vector
|
||||
# connecting the upper-right point with the lower left one.
|
||||
struct Box
|
||||
{
|
||||
# delta.x or .y is >= 0 for normal boxes
|
||||
# delta.x < 0 or delta.y indicates an empty box
|
||||
p1 @0 :Point;
|
||||
delta @1 :Vector;
|
||||
}
|
||||
|
||||
# An edge
|
||||
# An edge is a connection between two points.
|
||||
# Edges are implemented by on point and a vector connecting a
|
||||
# second point with the first one.
|
||||
struct Edge
|
||||
{
|
||||
p1 @0 :Point;
|
||||
delta @1 :Vector;
|
||||
}
|
||||
|
||||
# An edge pair
|
||||
# An edge pair is the combination of two edges. Edge pairs are
|
||||
# useful objects to describe DRC errors.
|
||||
struct EdgePair
|
||||
{
|
||||
e1 @0 :Edge;
|
||||
e2 @1 :Edge;
|
||||
}
|
||||
|
||||
# A contour
|
||||
# A contour is a sequence of points. Here, the contour is described
|
||||
# by a first point and vectors connecting every point to it's
|
||||
# successor.
|
||||
struct Contour
|
||||
{
|
||||
# p1 is the first point, deltas are the differences
|
||||
# to the next point. I.e.
|
||||
# points = { p1, p1+delta[0], p1+delta[0]+delta[1] ... }
|
||||
p1 @0 :Point;
|
||||
deltas @1 :List(Vector);
|
||||
}
|
||||
|
||||
# A simple polygon
|
||||
# A simple polygon is made from one contour. The contour forms
|
||||
# the hull of the polygon. First and last point are implicitly
|
||||
# connected.
|
||||
# The contour shall be orientated clockwise and should not
|
||||
# be self-intersecting. If can be self-touching to make polygons
|
||||
# with holes.
|
||||
# The hull must have three points at least.
|
||||
# No repeated points must be present and degenerated sequences
|
||||
# such as reflecting edges or collinear edge pairs should be avoided,
|
||||
# as they are not guaranteed to be preserved.
|
||||
struct SimplePolygon
|
||||
{
|
||||
hull @0 :Contour;
|
||||
}
|
||||
|
||||
# A polygon with holes
|
||||
# Like the simple polygon, but adds holes to the polygon.
|
||||
# The holes are described by contours as well as the hull.
|
||||
# Hole contours must not be overlapping and shall be
|
||||
# oriented counterclockwise.
|
||||
# The same restrictions apply for the holes as for the hull
|
||||
# contour.
|
||||
struct Polygon
|
||||
{
|
||||
hull @0 :Contour;
|
||||
holes @1 :List(Contour);
|
||||
}
|
||||
|
||||
# A path
|
||||
# A path is a list of points in form of a contour which
|
||||
# are connected by a wide line. The width of the line
|
||||
# is specified as the half-width to enforce on-gridness
|
||||
# of the boundary of the path. The point sequence is
|
||||
# called the path's "spine".
|
||||
# The line ends can be configured to be flat, square,
|
||||
# circular or round.
|
||||
# The spine needs to have at least one point.
|
||||
# Paths with single points are allowed. With square
|
||||
# ends, this represents a square, with round ends this
|
||||
# represents a circle.
|
||||
struct Path
|
||||
{
|
||||
# The spine
|
||||
spine @0 :Contour;
|
||||
|
||||
# The path's half width
|
||||
halfWidth @1 :UInt64;
|
||||
|
||||
# Extension at the start and end -
|
||||
# only valid with extensionType "variable":
|
||||
beginExtension @2 :Int64;
|
||||
endExtension @3 :Int64;
|
||||
|
||||
# The type of extension
|
||||
extensionType @4 :ExtensionType;
|
||||
|
||||
enum ExtensionType
|
||||
{
|
||||
flush @0; # flat
|
||||
square @1; # square
|
||||
round @2; # circular
|
||||
variable @3; # variable (given by "beginExtension" and "endExtension")
|
||||
}
|
||||
}
|
||||
|
||||
# A text
|
||||
# "texts" are not called "Text" as not to collide with Cap'n'Proto's
|
||||
# built-in "Text" type.
|
||||
# A text is a label at a specific position.
|
||||
struct Label
|
||||
{
|
||||
# The position of the label
|
||||
position @0 :Point;
|
||||
|
||||
# The orientation of the label
|
||||
orientation @1 :FixPointTransformation;
|
||||
|
||||
# base-0 index in the Header::TextStringsTable list
|
||||
stringId @2 :UInt64;
|
||||
|
||||
# Alignment
|
||||
horizontalAlign @3 :HAlignment;
|
||||
verticalAlign @4 :VAlignment;
|
||||
|
||||
# The offset by which the text is displayed relative to the
|
||||
# position (this feature is ignored as of now)
|
||||
displayOffset @5 :Vector;
|
||||
|
||||
# Text height in DBU
|
||||
size @6 :UInt64;
|
||||
|
||||
# Horizontal alignment flags
|
||||
enum HAlignment
|
||||
{
|
||||
left @0;
|
||||
center @1;
|
||||
right @2;
|
||||
}
|
||||
|
||||
# Vertical alignment flags
|
||||
enum VAlignment
|
||||
{
|
||||
bottom @0;
|
||||
center @1;
|
||||
top @2;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,40 @@
|
|||
|
||||
@0xc5f5e75ece54ff24;
|
||||
|
||||
using Cxx = import "/capnp/c++.capnp";
|
||||
$Cxx.namespace("stream::header");
|
||||
|
||||
using MetaData = import "metaData.capnp".MetaData;
|
||||
|
||||
# A library dictionary entry
|
||||
# These entries are used later to form the library list
|
||||
struct LibrarySpec
|
||||
{
|
||||
# The name of the library
|
||||
name @0 :Text;
|
||||
|
||||
# The type of library:
|
||||
# The type carries information about the usage of the library.
|
||||
# Types are:
|
||||
# "layout": traverses "layout" views
|
||||
# "schematic": traverses "schematic" views through "symbol"
|
||||
# more t.b.d
|
||||
type @1 :Text;
|
||||
}
|
||||
|
||||
# The global header
|
||||
struct Header
|
||||
{
|
||||
# File-global meta data
|
||||
metaData @0 :MetaData;
|
||||
|
||||
# The name of the tool that generated this file
|
||||
generator @1 :Text;
|
||||
|
||||
# The technology this stream is intended for
|
||||
# This is an arbitrary string as of now.
|
||||
technology @2 :Text;
|
||||
|
||||
# The list of libraries contained in this stream
|
||||
libraries @3 :List(LibrarySpec);
|
||||
}
|
||||
|
|
@ -0,0 +1,139 @@
|
|||
@0x973a841036ae34e0;
|
||||
|
||||
using Cxx = import "/capnp/c++.capnp";
|
||||
$Cxx.namespace("stream::layoutView");
|
||||
|
||||
using Box = import "geometry.capnp".Box;
|
||||
using Polygon = import "geometry.capnp".Polygon;
|
||||
using SimplePolygon = import "geometry.capnp".SimplePolygon;
|
||||
using Edge = import "geometry.capnp".Edge;
|
||||
using EdgePair = import "geometry.capnp".EdgePair;
|
||||
using Path = import "geometry.capnp".Path;
|
||||
using Point = import "geometry.capnp".Point;
|
||||
using Vector = import "geometry.capnp".Vector;
|
||||
using Label = import "geometry.capnp".Label;
|
||||
using FixPointTransformation = import "geometry.capnp".FixPointTransformation;
|
||||
using Repetition = import "repetition.capnp".Repetition;
|
||||
|
||||
struct SingleObject(Object)
|
||||
{
|
||||
basic @0 :Object;
|
||||
}
|
||||
|
||||
struct ObjectArray(Object)
|
||||
{
|
||||
basic @0 :Object;
|
||||
|
||||
# "repetitionId" is 0 for single instance, otherwise it's a base-1 index in the
|
||||
# "Layer::repetitions" list
|
||||
repetitionId @1 :UInt64;
|
||||
}
|
||||
|
||||
struct ObjectWithProperties(Object)
|
||||
{
|
||||
basic @0 :Object;
|
||||
|
||||
# "propertySetId" is 0 for "no properties", otherwise it's a base-1 index in the
|
||||
# "Header::propertiesTable::propertySets" list.
|
||||
propertySetId @1 :UInt64;
|
||||
}
|
||||
|
||||
struct ObjectContainerForType(Object)
|
||||
{
|
||||
basic @0 :List(SingleObject(Object)); # NOTE: can't be "List(Object)" simply
|
||||
withProperties @1 :List(ObjectWithProperties(Object));
|
||||
arrays @2 :List(ObjectArray(Object));
|
||||
arraysWithProperties @3 :List(ObjectWithProperties(ObjectArray(Object)));
|
||||
}
|
||||
|
||||
# A layer
|
||||
# A layer is a collection of objects - with repetitions and/or properties.
|
||||
# "objects" can be geometrical objects such as boxes and others.
|
||||
struct Layer
|
||||
{
|
||||
# The layer index - this is a base-0 index into Library::layerTable::layerEntries
|
||||
layerId @0 :UInt64;
|
||||
|
||||
# The repetitions
|
||||
# The "repetitionId" specified above is a base-1 index in that this.
|
||||
repetitions @1 :List(Repetition);
|
||||
|
||||
# Containers for the different objects the layer can be composed of.
|
||||
# Every container can hold objects with properties and/or repetitions.
|
||||
boxes @2 :ObjectContainerForType(Box);
|
||||
polygons @3 :ObjectContainerForType(Polygon);
|
||||
simplePolygons @4 :ObjectContainerForType(SimplePolygon);
|
||||
paths @5 :ObjectContainerForType(Path);
|
||||
labels @6 :ObjectContainerForType(Label);
|
||||
edges @7 :ObjectContainerForType(Edge);
|
||||
edgePairs @8 :ObjectContainerForType(EdgePair);
|
||||
points @9 :ObjectContainerForType(Point);
|
||||
}
|
||||
|
||||
# Specifies a transformation for a cell
|
||||
# Transformations can be "simple": such transformations
|
||||
# do not allow arbitrary angle rotations or scaling.
|
||||
# "complex" transformations on the other hand, support
|
||||
# arbitrary angle rotations and scaling but come with
|
||||
# potential issues with off-grid vertexes rendered
|
||||
# by their resulting geometries.
|
||||
#
|
||||
# The order of the transformations in the simple cases is:
|
||||
# 1. Apply simple.orientation
|
||||
# 2. Apply displacement (shift)
|
||||
#
|
||||
# In the complex case the order is:
|
||||
# 1. Multiplication by the "scale" factor
|
||||
# 2. Mirror at x axis if "mirror" is true
|
||||
# 3. Rotate by "angle" degrees counter-clockwise
|
||||
# 4. Apply displacement (shift)
|
||||
|
||||
struct CellTransformation
|
||||
{
|
||||
displacement @0 :Vector;
|
||||
|
||||
transformation :union {
|
||||
simple :group {
|
||||
orientation @1 : FixPointTransformation;
|
||||
}
|
||||
complex :group {
|
||||
angle @2 :Float64; # rotation angle in degree
|
||||
mirror @3 :Bool; # at x axis before rotation
|
||||
scale @4 :Float64; # before rotation, mirror and displacement
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
# A cell placement
|
||||
struct CellInstance
|
||||
{
|
||||
# This is a base-0 index into Library::cellSpecsTable::cellSpecs
|
||||
cellId @0 :UInt64;
|
||||
|
||||
# The transformation describes how the cell is placed
|
||||
transformation @1 :CellTransformation;
|
||||
}
|
||||
|
||||
# The LayoutView class:
|
||||
# This message represents the entire layout view of a cell
|
||||
struct LayoutView
|
||||
{
|
||||
# The cell bounding box
|
||||
# This bounding box includes all geometries, including child cells
|
||||
# but maybe larger than the actual size due to shapes not written
|
||||
# to the stream.
|
||||
boundingBox @0 :Box;
|
||||
|
||||
# The layers present in the layout view
|
||||
layers @1 :List(Layer);
|
||||
|
||||
# The repetitions used for the cell instances
|
||||
instanceRepetitions @2 :List(Repetition);
|
||||
|
||||
# The cell instance container: lists cell instances with properties
|
||||
# and/or repetitions.
|
||||
# Regular array repetitions play a special role as they are preserved
|
||||
# in edit mode.
|
||||
instances @3 :ObjectContainerForType(CellInstance);
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,265 @@
|
|||
@0x86931e1824fec888;
|
||||
|
||||
using Cxx = import "/capnp/c++.capnp";
|
||||
$Cxx.namespace("stream::library");
|
||||
|
||||
using MetaData = import "metaData.capnp".MetaData;
|
||||
using PropertySet = import "propertySet.capnp".PropertySet;
|
||||
using PropertyName = import "propertySet.capnp".PropertyName;
|
||||
using NamedValue = import "propertySet.capnp".NamedValue;
|
||||
using Box = import "geometry.capnp".Box;
|
||||
|
||||
using Variant = import "variant.capnp".Variant;
|
||||
|
||||
# A table listing the names of the properties used in this library
|
||||
struct PropertyNamesTable
|
||||
{
|
||||
# Namespaces are intended to separate property names which are otherwise
|
||||
# identical. Different applications or system can define their own namespace
|
||||
# which acts as a prefix to the property names.
|
||||
# The "namespaceId" used in PropertyName is a base-1 index in this table
|
||||
namespaces @0 :List(Text);
|
||||
|
||||
# Names with namespace Ids:
|
||||
# The "nameId" used in PropertySet is a base-0 index in this table
|
||||
names @1 :List(PropertyName);
|
||||
}
|
||||
|
||||
# A table of all property/name combinations used in this library:
|
||||
# Shapes or other objects specifying properties do not carry a dictionary,
|
||||
# but just state the "Id" of the property set, which is a pointer into
|
||||
# this table. This serves the compactness goal of the format as properties
|
||||
# are often repeated.
|
||||
struct PropertiesTable
|
||||
{
|
||||
# NOTE: the propertyId used in many places is 0 for "no property"
|
||||
# otherwise "propertyId" is the base-1 index of the property set in this list
|
||||
propertySets @0 :List(PropertySet);
|
||||
}
|
||||
|
||||
# A table of all text (label) strings used:
|
||||
# A label object does not directly specify the text, but stores a
|
||||
# base-0 index into this table. This also serves the compactness goal.
|
||||
struct TextStringsTable
|
||||
{
|
||||
textStrings @0 :List(Text);
|
||||
}
|
||||
|
||||
# A reference to a library:
|
||||
# This is merely a pointer to an external entity. It is up to the
|
||||
# application to resolve this reference.
|
||||
struct LibraryRef
|
||||
{
|
||||
libraryName @0 :Text;
|
||||
}
|
||||
|
||||
# A list of all library references
|
||||
struct LibraryRefs
|
||||
{
|
||||
refs @0 :List(LibraryRef);
|
||||
}
|
||||
|
||||
# A structure describing the parameters of a cell
|
||||
# Cell parameters are name/value pairs. It is up to the application
|
||||
# to provide a cell implementation and identify the parameters to use.
|
||||
struct CellParameters
|
||||
{
|
||||
values @0 :List(NamedValue);
|
||||
}
|
||||
|
||||
# A cell header:
|
||||
# This structure describes a cell inside a library. A cell is primarily
|
||||
# given by a name which must be unique inside the library. A cell can refer
|
||||
# to a separate library and/or a parameterized cell.
|
||||
# an any case, the cell's actual content is copied into the stream, so a
|
||||
# consumer of a stream can obtain the actual geometry of a cell, instead
|
||||
# of having to find the provider to build it.
|
||||
struct CellSpec
|
||||
{
|
||||
# The name of the cell in the current stream. This needs to be a unique name.
|
||||
# This attribute is mandatory. If the cell refers to a library cell, the cell
|
||||
# name inside the library can be different from the cell name.
|
||||
name @0 :Text;
|
||||
|
||||
# Specifies, whether the cell refers to a library.
|
||||
# "libraryNameId" is 0 for a local cell (no library reference), otherwise it's a base-1
|
||||
# index into "Header::libraryRefs".
|
||||
libraryRefId @1 :UInt64;
|
||||
|
||||
# The name of the cell inside the library, if one is specified
|
||||
libraryCellName @2 :Text;
|
||||
|
||||
# The cell parameters, if the cell is a parameterized cell.
|
||||
parameters @3 :CellParameters;
|
||||
|
||||
# "propertySetId" is 0 for "no properties", otherwise it's a base-1 index in the
|
||||
# "Header::propertiesTable::propertySets" list.
|
||||
propertySetId @4 :UInt64;
|
||||
}
|
||||
|
||||
# A table of all cells
|
||||
struct CellSpecsTable
|
||||
{
|
||||
cellSpecs @0 :List(CellSpec);
|
||||
}
|
||||
|
||||
# A node in the hierarchy tree:
|
||||
# The hierarchy tree lists all cells with their children.
|
||||
struct CellHierarchyTreeNode
|
||||
{
|
||||
# The cellId is a base-0 index in CellSpecsTable::cellSpecs
|
||||
cellId @0 :UInt64;
|
||||
|
||||
# Same for the child cell Ids
|
||||
childCellIds @1 :List(UInt64);
|
||||
}
|
||||
|
||||
# The full hierarchy tree
|
||||
struct CellHierarchyTree
|
||||
{
|
||||
# The number of top cells (cells without a parent)
|
||||
# As the "nodes" list is sorted top-down, the first
|
||||
# "numberOfTopCells" cells are actually top cells.
|
||||
numberOfTopCells @0 :UInt64;
|
||||
|
||||
# top-down sorted cells
|
||||
nodes @1 :List(CellHierarchyTreeNode);
|
||||
}
|
||||
|
||||
# A layer specification:
|
||||
# A layer can be specified by a several layer numbers
|
||||
# and/or a name. If no numbers are given, the name will
|
||||
# identify the layer. Otherwise the numbers will identify
|
||||
# the layer.
|
||||
# Layers can be unnamed and unnumbered and layer specifications
|
||||
# do not need to be unique.
|
||||
# The purpose is a hint and additionally identifies the
|
||||
# purpose of the shapes on the layer.
|
||||
struct LayerEntry
|
||||
{
|
||||
# layerNumbers = [] for no layer/datatype,
|
||||
# [layer] for single layer/no datatype
|
||||
# [layer, datatype] for GDS2 layer/datatype
|
||||
layerNumbers @0 :List(UInt64);
|
||||
name @1 :Text;
|
||||
purpose @2 :Purpose;
|
||||
|
||||
enum Purpose {
|
||||
drawing @0; # default
|
||||
fill @1;
|
||||
slot @2;
|
||||
pin @3;
|
||||
boundary @4;
|
||||
text @5;
|
||||
comment @6;
|
||||
blockage @7;
|
||||
wire @8;
|
||||
errors @9;
|
||||
handles @10;
|
||||
symbol @11;
|
||||
}
|
||||
}
|
||||
|
||||
# All layer entries
|
||||
struct LayerTable
|
||||
{
|
||||
# The layerId used inside the LayoutView struct is a
|
||||
# base-0 index into this table.
|
||||
layerEntries @0 :List(LayerEntry);
|
||||
}
|
||||
|
||||
# A specification for a view
|
||||
struct ViewSpec
|
||||
{
|
||||
# The view name: the view name carries information about
|
||||
# the usage - e.g. "layout", "metaData", "abstractLayout", "schematic", "symbol" ...
|
||||
name @0 :Text;
|
||||
|
||||
# The class representing the view
|
||||
# For layout views, this is "LayoutView".
|
||||
class @1 :Text;
|
||||
|
||||
# The resolution: this is the number of database
|
||||
# units per micrometer. This specification is favored
|
||||
# over database unit in micrometers as this is usually
|
||||
# an integer number.
|
||||
# As of now, only layout views need this resolution value as they represent
|
||||
# geometries in integer multiples of the resolution.
|
||||
# If not used, this value should be zero.
|
||||
resolution @2 :Float64;
|
||||
|
||||
# The layer table:
|
||||
# All layers used in this stream are listed here.
|
||||
# Layers can be present without being used (in a sense of having shapes in them).
|
||||
# On the contrary, layers must be listed here, before they can be used for shapes.
|
||||
layerTable @3 :LayerTable;
|
||||
|
||||
# View properties:
|
||||
# "propertySetId" is 0 for "no properties", otherwise it's a base-1 index in the
|
||||
# "Header::propertiesTable::propertySets" list.
|
||||
# For layout views, this corresponds to OASIS file properties for example.
|
||||
propertySetId @4 :UInt64;
|
||||
|
||||
# Meta data attached to the view type
|
||||
metaData @5 :MetaData;
|
||||
}
|
||||
|
||||
# A table of all views
|
||||
struct ViewSpecsTable
|
||||
{
|
||||
# The "viewIds" used in the "Cell" structure is a base-0 index into this
|
||||
# list.
|
||||
viewSpecs @0 :List(ViewSpec);
|
||||
}
|
||||
|
||||
# The header for a library
|
||||
struct Library
|
||||
{
|
||||
# Meta data:
|
||||
# Meta data is a generic container for arbitrary data attached to the stream.
|
||||
# In contrast to properties, meta data is available on cell and library level
|
||||
# only and is intended for application specific data.
|
||||
metaData @0 :MetaData;
|
||||
|
||||
# Library names:
|
||||
# The "libraryNameId" used in this scheme refers to this table
|
||||
# as a base-1 index into it. A "libraryNameId" of 0 means "no library referenced".
|
||||
libraryRefs @1 :LibraryRefs;
|
||||
|
||||
# Property names:
|
||||
# The "nameId" used in a number of places in the scheme refers
|
||||
# to this table as a base-0 index into it.
|
||||
propertyNamesTable @2 :PropertyNamesTable;
|
||||
|
||||
# Properties tables:
|
||||
# The "propertySetId" used in many places in this schema refers to
|
||||
# this table as a base-1 index into it. A property set Id of 0
|
||||
# indicates "no properties".
|
||||
propertiesTable @3 :PropertiesTable;
|
||||
|
||||
# Text strings:
|
||||
# This text string repository is mainly used by layout views for
|
||||
# compact representation of text strings.
|
||||
textStringsTable @4 :TextStringsTable;
|
||||
|
||||
# View specs table:
|
||||
# Defines the views with some additional attributes. Not all views
|
||||
# listed here need to be used by the cells. Every cell selects
|
||||
# views from this list. However, a cell cannot select a view that is
|
||||
# not in this list.
|
||||
viewSpecsTable @5 :ViewSpecsTable;
|
||||
|
||||
# The cell specifications:
|
||||
# The cell specifications describe the cell's origin and
|
||||
# attributes of the cell.
|
||||
cellSpecsTable @6 :CellSpecsTable;
|
||||
|
||||
# The cell hierarchy tree:
|
||||
# This tree is mandatory for pure layout streams. It provides
|
||||
# quick access to the structure, so stream processing can be planned
|
||||
# in some cases by just reading the header.
|
||||
cellHierarchyTree @7 :CellHierarchyTree;
|
||||
}
|
||||
|
||||
# Followed by many "Cell" messages
|
||||
|
||||
|
|
@ -0,0 +1,30 @@
|
|||
@0x91d51203f4528da2;
|
||||
|
||||
using Cxx = import "/capnp/c++.capnp";
|
||||
$Cxx.namespace("stream::metaData");
|
||||
|
||||
using Variant = import "variant.capnp".Variant;
|
||||
|
||||
# An entry for meta data
|
||||
struct MetaDataEntry
|
||||
{
|
||||
# The key
|
||||
name @0 :Text;
|
||||
|
||||
# Some optional description text
|
||||
description @1 :Text;
|
||||
|
||||
# The value
|
||||
value @2 :Variant;
|
||||
}
|
||||
|
||||
# The MetaData View class:
|
||||
# This message represents the meta data view of cell.
|
||||
# Meta data is a generic concept - basically a list of
|
||||
# key/value pairs for custom payload, with not specific
|
||||
# implied interpretation by the application.
|
||||
struct MetaData
|
||||
{
|
||||
entries @0 :List(MetaDataEntry);
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
@0xf401d688f5f6eb25;
|
||||
|
||||
using Cxx = import "/capnp/c++.capnp";
|
||||
$Cxx.namespace("stream::metaDataView");
|
||||
|
||||
using MetaData = import "metaData.capnp".MetaData;
|
||||
|
||||
# A meta data view for a cell:
|
||||
# A cell can add arbirary key/value information through this view.
|
||||
struct MetaDataView
|
||||
{
|
||||
data @0 :MetaData;
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,39 @@
|
|||
@0xa344c0f52014bff4;
|
||||
|
||||
using Cxx = import "/capnp/c++.capnp";
|
||||
$Cxx.namespace("stream::propertySet");
|
||||
|
||||
using Variant = import "variant.capnp".Variant;
|
||||
|
||||
# The name of a shape or instance property
|
||||
struct PropertyName
|
||||
{
|
||||
# A "namespaceID" of 0 means "no namespace". Otherwise it's a base-1 index in the
|
||||
# property namespace table in "header::propertyNamesTable::namespaces".
|
||||
# The namespace is intended as a kind of prefix, uniquely identifying the name
|
||||
# of the property, so that different owners can use the same name as long as the
|
||||
# own the namespace.
|
||||
namespaceId @0 :UInt64;
|
||||
|
||||
# The "name":
|
||||
# The property name does not need to be a string, but can be any type,
|
||||
# specifically integer values. This way, properties can map GDS user properties.
|
||||
name @1 :Variant;
|
||||
}
|
||||
|
||||
# A pair of name and value
|
||||
struct NamedValue
|
||||
{
|
||||
# The namdId is a base-0 index into Library::propertyNamesTable
|
||||
nameId @0 :UInt64;
|
||||
|
||||
# The value associated with the name
|
||||
value @1 :Variant;
|
||||
}
|
||||
|
||||
# A set of name/value pairs forming the set of properties for a shape or instance
|
||||
struct PropertySet
|
||||
{
|
||||
properties @0 :List(NamedValue);
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,57 @@
|
|||
@0x9c4548253282e237;
|
||||
|
||||
using Cxx = import "/capnp/c++.capnp";
|
||||
$Cxx.namespace("stream::repetition");
|
||||
|
||||
using Vector = import "geometry.capnp".Vector;
|
||||
|
||||
# A regular array with x and y spacing
|
||||
# The displacements of an object are:
|
||||
# disp = (ix*dx, iy*dy)
|
||||
# where ix=0..nx-1 and iy=0..ny-1
|
||||
struct RegularOrthoRepetition
|
||||
{
|
||||
dx @0 :Int64;
|
||||
dy @1 :Int64;
|
||||
nx @2 :UInt64;
|
||||
ny @3 :UInt64;
|
||||
}
|
||||
|
||||
# A regular array with free step vectors which do not need to be orthogonal
|
||||
# The displacements of an object are:
|
||||
# disp = ia*a+ib*b
|
||||
# where ia=0..na-1 and ib=0..nb-1
|
||||
struct RegularRepetition
|
||||
{
|
||||
a @0 :Vector;
|
||||
b @1 :Vector;
|
||||
na @2 :UInt64;
|
||||
nb @3 :UInt64;
|
||||
}
|
||||
|
||||
# A free repetition given by a set of displacements
|
||||
struct EnumeratedRepetition
|
||||
{
|
||||
# The number of instances represented by this repetition type is one
|
||||
# more than the length of the list. The first entry is implicitly
|
||||
# assumed to be (0,0) and is dropped.
|
||||
# The list is given in incremental offsets.
|
||||
# So the offsets are:
|
||||
# offsets = { (0,0), delta[0], delta[0]+delta[1] ... }
|
||||
deltas @0 :List(Vector);
|
||||
}
|
||||
|
||||
# A generic repetition object
|
||||
# This union describes a set of object "placements".
|
||||
# Placements are basically shifts of some original
|
||||
# object by a given vector.
|
||||
struct Repetition
|
||||
{
|
||||
types :union {
|
||||
single @0 :Vector;
|
||||
regular @1 :RegularRepetition;
|
||||
regularOrtho @2 :RegularOrthoRepetition;
|
||||
enumerated @3 :EnumeratedRepetition;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,27 @@
|
|||
@0x92e3d852e5f6a442;
|
||||
|
||||
using Cxx = import "/capnp/c++.capnp";
|
||||
$Cxx.namespace("stream::variant");
|
||||
|
||||
# A helper struct to build a dictionary of key/value pairs
|
||||
struct ArrayEntry
|
||||
{
|
||||
key @0 :Variant;
|
||||
value @1 :Variant;
|
||||
}
|
||||
|
||||
# A generic type representing a number of C++ types
|
||||
struct Variant {
|
||||
value :union {
|
||||
nil @0 :Void;
|
||||
bool @1 :Bool;
|
||||
uint64 @2 :UInt64;
|
||||
int64 @3 :Int64;
|
||||
double @4 :Float64;
|
||||
text @5 :Text;
|
||||
list @6 :List(Variant);
|
||||
array @7 :List(ArrayEntry);
|
||||
object @8 :Text;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,28 @@
|
|||
|
||||
TARGET = lstream
|
||||
DESTDIR = $$OUT_PWD/../../../../db_plugins
|
||||
|
||||
include($$PWD/../../../db_plugin.pri)
|
||||
include($$PWD/../lstream.pri)
|
||||
include($$PWD/capnp/capnp.pri)
|
||||
|
||||
INCLUDEPATH += capnp $$VERSION_INC
|
||||
LIBS += -L$$DESTDIR/.. -lxcapnp -lxkj
|
||||
|
||||
HEADERS += \
|
||||
lstrCompressed.h \
|
||||
lstrCompressor.h \
|
||||
lstrFormat.h \
|
||||
lstrPlugin.h \
|
||||
lstrReader.h \
|
||||
lstrWriter.h \
|
||||
|
||||
SOURCES += \
|
||||
gsiDeclLStream.cc \
|
||||
lstrCompressed.cc \
|
||||
lstrCompressor.cc \
|
||||
lstrFormat.cc \
|
||||
lstrPlugin.cc \
|
||||
lstrReader.cc \
|
||||
lstrWriter.cc \
|
||||
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
#!/bin/bash -e
|
||||
|
||||
rm -rf capnp_src
|
||||
mkdir capnp_src
|
||||
rm -f *.cc *.h
|
||||
|
||||
tmp=.tmp
|
||||
rm -rf $tmp
|
||||
mkdir $tmp
|
||||
cd $tmp
|
||||
|
||||
git clone ssh://git@codeberg.org/klayoutmatthias/lstream.git .
|
||||
|
||||
cp capnp/*.capnp ../capnp_src
|
||||
cp db_plugin/*{cc,h} ..
|
||||
cd ..
|
||||
|
||||
./capnp_compile.sh
|
||||
|
||||
|
|
@ -0,0 +1,126 @@
|
|||
|
||||
/*
|
||||
|
||||
KLayout Layout Viewer
|
||||
Copyright (C) 2006-2025 Matthias Koefferlein
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
*/
|
||||
|
||||
#include "lstrFormat.h"
|
||||
#include "dbLoadLayoutOptions.h"
|
||||
#include "dbSaveLayoutOptions.h"
|
||||
#include "gsiDecl.h"
|
||||
|
||||
namespace lstr
|
||||
{
|
||||
|
||||
// ---------------------------------------------------------------
|
||||
// gsi Implementation of specific methods of LoadLayoutOptions
|
||||
|
||||
static void set_lstream_bbox_meta_info_key (db::LoadLayoutOptions *options, const std::string &key)
|
||||
{
|
||||
options->get_options<lstr::ReaderOptions> ().bbox_meta_info_key = key;
|
||||
}
|
||||
|
||||
static const std::string &get_lstream_bbox_meta_info_key (const db::LoadLayoutOptions *options)
|
||||
{
|
||||
return options->get_options<lstr::ReaderOptions> ().bbox_meta_info_key;
|
||||
}
|
||||
|
||||
// extend lay::LoadLayoutOptions with the OASIS options
|
||||
static
|
||||
gsi::ClassExt<db::LoadLayoutOptions> lstream_reader_options (
|
||||
gsi::method_ext ("lstream_bbox_meta_info_key=", &set_lstream_bbox_meta_info_key, gsi::arg ("key"),
|
||||
"@brief If not an empty string, this attribute specifies the key under which the cell bounding box information is stored"
|
||||
) +
|
||||
gsi::method_ext ("lstream_bbox_meta_info_key", &get_lstream_bbox_meta_info_key,
|
||||
"@brief If not an empty string, this attribute specifies the key under which the cell bounding box information is stored"
|
||||
),
|
||||
""
|
||||
);
|
||||
|
||||
// ---------------------------------------------------------------
|
||||
// gsi Implementation of specific methods
|
||||
|
||||
static void set_lstream_compression (db::SaveLayoutOptions *options, int comp)
|
||||
{
|
||||
options->get_options<lstr::WriterOptions> ().compression_level = comp;
|
||||
}
|
||||
|
||||
static int get_lstream_compression (const db::SaveLayoutOptions *options)
|
||||
{
|
||||
return options->get_options<lstr::WriterOptions> ().compression_level;
|
||||
}
|
||||
|
||||
static void set_lstream_recompress (db::SaveLayoutOptions *options, bool f)
|
||||
{
|
||||
options->get_options<lstr::WriterOptions> ().recompress = f;
|
||||
}
|
||||
|
||||
static bool get_lstream_recompress (const db::SaveLayoutOptions *options)
|
||||
{
|
||||
return options->get_options<lstr::WriterOptions> ().recompress;
|
||||
}
|
||||
|
||||
static void set_lstream_permissive (db::SaveLayoutOptions *options, bool f)
|
||||
{
|
||||
options->get_options<lstr::WriterOptions> ().permissive = f;
|
||||
}
|
||||
|
||||
static bool get_lstream_permissive (const db::SaveLayoutOptions *options)
|
||||
{
|
||||
return options->get_options<lstr::WriterOptions> ().permissive;
|
||||
}
|
||||
|
||||
// extend lay::SaveLayoutOptions with the OASIS options
|
||||
static
|
||||
gsi::ClassExt<db::SaveLayoutOptions> lstream_writer_options (
|
||||
gsi::method_ext ("lstream_recompress=", &set_lstream_recompress, gsi::arg ("flag"),
|
||||
"@brief Sets LStream recompression mode\n"
|
||||
"If this flag is true, shape arrays already existing will be resolved and compression is applied "
|
||||
"to the individual shapes again. If this flag is false (the default), shape arrays already existing "
|
||||
"will be written as such.\n"
|
||||
) +
|
||||
gsi::method_ext ("lstream_recompress?", &get_lstream_recompress,
|
||||
"@brief Gets the LStream recompression mode\n"
|
||||
"See \\oasis_recompress= method for a description of this predicate."
|
||||
) +
|
||||
gsi::method_ext ("lstream_permissive=", &set_lstream_permissive, gsi::arg ("flag"),
|
||||
"@brief Sets LStream permissive mode\n"
|
||||
"If this flag is true, certain shapes which cannot be written to LStream are reported as warnings, "
|
||||
"not as errors. For example, paths with odd width (are rounded).\n"
|
||||
) +
|
||||
gsi::method_ext ("lstream_permissive?", &get_lstream_permissive,
|
||||
"@brief Gets the LStream permissive mode\n"
|
||||
"See \\oasis_permissive= method for a description of this predicate."
|
||||
) +
|
||||
gsi::method_ext ("lstream_compression_level=", &set_lstream_compression, gsi::arg ("level"),
|
||||
"@brief Set the LStream compression level\n"
|
||||
"The LStream compression level is an integer number between 0 and 10. 0 basically is no compression, "
|
||||
"1 produces shape arrays in a simple fashion. 2 and higher compression levels will use a more elaborate "
|
||||
"algorithm to find shape arrays which uses 2nd and further neighbor distances. The higher the level, the "
|
||||
"higher the memory requirements and run times.\n"
|
||||
) +
|
||||
gsi::method_ext ("lstream_compression_level", &get_lstream_compression,
|
||||
"@brief Get the LStream compression level\n"
|
||||
"See \\oasis_compression_level= method for a description of the LStream compression level."
|
||||
),
|
||||
""
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,531 @@
|
|||
|
||||
/*
|
||||
|
||||
KLayout Layout Viewer
|
||||
Copyright (C) 2006-2025 Matthias Koefferlein
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
*/
|
||||
|
||||
#include "lstrCompressed.h"
|
||||
|
||||
#include "dbPluginCommon.h"
|
||||
#include "dbShapes.h"
|
||||
#include "dbHash.h"
|
||||
|
||||
namespace lstr
|
||||
{
|
||||
|
||||
Compressed::Compressed ()
|
||||
: m_next_id (0)
|
||||
{
|
||||
// .. nothing yet ..
|
||||
}
|
||||
|
||||
uint64_t
|
||||
Compressed::make_rep_id (const RegularArray &array, const std::vector<db::Vector> &irregular)
|
||||
{
|
||||
if (! array.is_null ()) {
|
||||
|
||||
auto ia = m_array_to_rep_id.find (array);
|
||||
if (ia != m_array_to_rep_id.end ()) {
|
||||
return ia->second;
|
||||
} else {
|
||||
++m_next_id;
|
||||
m_array_to_rep_id.insert (std::make_pair (array, m_next_id));
|
||||
return m_next_id;
|
||||
}
|
||||
|
||||
} else if (! irregular.empty ()) {
|
||||
|
||||
auto ii = m_irregular_to_rep_id.find (irregular);
|
||||
if (ii != m_irregular_to_rep_id.end ()) {
|
||||
return ii->second;
|
||||
} else {
|
||||
++m_next_id;
|
||||
m_irregular_to_rep_id.insert (std::make_pair (irregular, m_next_id));
|
||||
return m_next_id;
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
return 0;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
template <class Obj>
|
||||
void
|
||||
Compressed::write_shape (const db::Shape &shape, const db::Vector &disp, RegularArray ®ular, std::vector<db::Vector> &irregular_array)
|
||||
{
|
||||
Obj sh;
|
||||
shape.instantiate (sh);
|
||||
if (! object_is_empty (sh)) {
|
||||
sh.move (disp);
|
||||
if (shape.prop_id () != 0) {
|
||||
write (db::object_with_properties<Obj> (sh, shape.prop_id ()), regular, irregular_array);
|
||||
} else {
|
||||
write (sh, regular, irregular_array);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
Compressed::compress_shapes (const db::Shapes &shapes, unsigned int level, bool recompress)
|
||||
{
|
||||
RegularArray no_array;
|
||||
std::vector<db::Vector> no_irregular_array;
|
||||
|
||||
Compressor<db::Path> path_compressor (level);
|
||||
Compressor<db::SimplePolygon> simple_polygon_compressor (level);
|
||||
Compressor<db::Polygon> polygon_compressor (level);
|
||||
Compressor<db::Edge> edge_compressor (level);
|
||||
Compressor<db::EdgePair> edge_pair_compressor (level);
|
||||
Compressor<db::Box> box_compressor (level);
|
||||
Compressor<db::Text> text_compressor (level);
|
||||
Compressor<db::Point> point_compressor (level);
|
||||
|
||||
Compressor<db::PathWithProperties> path_with_properties_compressor (level);
|
||||
Compressor<db::SimplePolygonWithProperties> simple_polygon_with_properties_compressor (level);
|
||||
Compressor<db::PolygonWithProperties> polygon_with_properties_compressor (level);
|
||||
Compressor<db::EdgeWithProperties> edge_with_properties_compressor (level);
|
||||
Compressor<db::EdgePairWithProperties> edge_pair_with_properties_compressor (level);
|
||||
Compressor<db::BoxWithProperties> box_with_properties_compressor (level);
|
||||
Compressor<db::TextWithProperties> text_with_properties_compressor (level);
|
||||
Compressor<db::PointWithProperties> point_with_properties_compressor (level);
|
||||
|
||||
for (db::ShapeIterator shape = shapes.begin (db::ShapeIterator::All); ! shape.at_end (); ) {
|
||||
|
||||
if (level <= 0 || (! recompress && shape.in_array ())) {
|
||||
|
||||
RegularArray array;
|
||||
std::vector<db::Vector> irregular_array;
|
||||
|
||||
bool transfer_array = (shape.in_array () && level > 0);
|
||||
db::Vector disp;
|
||||
if (transfer_array) {
|
||||
disp = create_repetition (shape.array (), array, irregular_array);
|
||||
}
|
||||
|
||||
if (shape->is_simple_polygon ()) {
|
||||
write_shape<db::SimplePolygon> (*shape, disp, array, irregular_array);
|
||||
} else if (shape->is_polygon ()) {
|
||||
write_shape<db::Polygon> (*shape, disp, array, irregular_array);
|
||||
} else if (shape->is_path ()) {
|
||||
write_shape<db::Path> (*shape, disp, array, irregular_array);
|
||||
} else if (shape->is_text ()) {
|
||||
write_shape<db::Text> (*shape, disp, array, irregular_array);
|
||||
} else if (shape->is_edge ()) {
|
||||
write_shape<db::Edge> (*shape, disp, array, irregular_array);
|
||||
} else if (shape->is_edge_pair ()) {
|
||||
write_shape<db::EdgePair> (*shape, disp, array, irregular_array);
|
||||
} else if (shape->is_box ()) {
|
||||
write_shape<db::Box> (*shape, disp, array, irregular_array);
|
||||
} else if (shape->is_point ()) {
|
||||
write_shape<db::Point> (*shape, disp, array, irregular_array);
|
||||
} else if (shape->is_user_object ()) {
|
||||
// ignore
|
||||
} else {
|
||||
tl_assert (false); // unknown shape type
|
||||
}
|
||||
|
||||
if (transfer_array) {
|
||||
shape.finish_array ();
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
switch (shape->type ()) {
|
||||
case db::Shape::Polygon:
|
||||
|
||||
if (shape->has_prop_id ()) {
|
||||
auto polygon = *shape->basic_ptr (db::PolygonWithProperties::tag ());
|
||||
polygon_with_properties_compressor.add (polygon);
|
||||
} else {
|
||||
auto polygon = *shape->basic_ptr (db::Polygon::tag ());
|
||||
polygon_compressor.add (polygon);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case db::Shape::PolygonRef:
|
||||
|
||||
if (shape->has_prop_id ()) {
|
||||
auto polygon_ref = *shape->basic_ptr (db::object_with_properties<db::PolygonRef>::tag ());
|
||||
db::PolygonWithProperties polygon (polygon_ref.obj (), polygon_ref.properties_id ());
|
||||
polygon_with_properties_compressor.add (polygon, polygon_ref.trans ().disp ());
|
||||
} else {
|
||||
auto polygon_ref = *shape->basic_ptr (db::PolygonRef::tag ());
|
||||
polygon_compressor.add (polygon_ref.obj (), polygon_ref.trans ().disp ());
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case db::Shape::PolygonPtrArrayMember:
|
||||
|
||||
if (shape->has_prop_id ()) {
|
||||
auto polygon_ref = *shape->basic_ptr (db::object_with_properties<db::Shape::polygon_ptr_array_type>::tag ());
|
||||
db::PolygonWithProperties polygon (polygon_ref.object ().obj (), polygon_ref.properties_id ());
|
||||
polygon_with_properties_compressor.add (polygon, shape->array_trans ().disp ());
|
||||
} else {
|
||||
auto polygon_ref = *shape->basic_ptr (db::Shape::polygon_ptr_array_type::tag ());
|
||||
polygon_compressor.add (polygon_ref.object ().obj (), shape->array_trans ().disp ());
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case db::Shape::SimplePolygon:
|
||||
|
||||
if (shape->has_prop_id ()) {
|
||||
auto simple_polygon = *shape->basic_ptr (db::SimplePolygonWithProperties::tag ());
|
||||
simple_polygon_with_properties_compressor.add (simple_polygon);
|
||||
} else {
|
||||
auto simple_polygon = *shape->basic_ptr (db::SimplePolygon::tag ());
|
||||
simple_polygon_compressor.add (simple_polygon);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case db::Shape::SimplePolygonRef:
|
||||
|
||||
if (shape->has_prop_id ()) {
|
||||
auto polygon_ref = *shape->basic_ptr (db::object_with_properties<db::SimplePolygonRef>::tag ());
|
||||
db::SimplePolygonWithProperties polygon (polygon_ref.obj (), polygon_ref.properties_id ());
|
||||
simple_polygon_with_properties_compressor.add (polygon, polygon_ref.trans ().disp ());
|
||||
} else {
|
||||
auto polygon_ref = *shape->basic_ptr (db::SimplePolygonRef::tag ());
|
||||
simple_polygon_compressor.add (polygon_ref.obj (), polygon_ref.trans ().disp ());
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case db::Shape::SimplePolygonPtrArrayMember:
|
||||
|
||||
if (shape->has_prop_id ()) {
|
||||
auto simple_polygon_ref = *shape->basic_ptr (db::object_with_properties<db::Shape::simple_polygon_ptr_array_type>::tag ());
|
||||
db::SimplePolygonWithProperties simple_polygon (simple_polygon_ref.object ().obj (), simple_polygon_ref.properties_id ());
|
||||
simple_polygon_with_properties_compressor.add (simple_polygon, shape->array_trans ().disp ());
|
||||
} else {
|
||||
auto simple_polygon_ref = *shape->basic_ptr (db::Shape::simple_polygon_ptr_array_type::tag ());
|
||||
simple_polygon_compressor.add (simple_polygon_ref.object ().obj (), shape->array_trans ().disp ());
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case db::Shape::Edge:
|
||||
|
||||
if (shape->has_prop_id ()) {
|
||||
auto edge = *shape->basic_ptr (db::EdgeWithProperties::tag ());
|
||||
edge_with_properties_compressor.add (edge);
|
||||
} else {
|
||||
auto edge = *shape->basic_ptr (db::Edge::tag ());
|
||||
edge_compressor.add (edge);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case db::Shape::EdgePair:
|
||||
|
||||
if (shape->has_prop_id ()) {
|
||||
auto edge_pair = *shape->basic_ptr (db::EdgePairWithProperties::tag ());
|
||||
edge_pair_with_properties_compressor.add (edge_pair);
|
||||
} else {
|
||||
auto edge_pair = *shape->basic_ptr (db::EdgePair::tag ());
|
||||
edge_pair_compressor.add (edge_pair);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case db::Shape::Path:
|
||||
|
||||
if (shape->has_prop_id ()) {
|
||||
auto path = *shape->basic_ptr (db::PathWithProperties::tag ());
|
||||
path_with_properties_compressor.add (path);
|
||||
} else {
|
||||
auto path = *shape->basic_ptr (db::Path::tag ());
|
||||
path_compressor.add (path);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case db::Shape::PathRef:
|
||||
|
||||
if (shape->has_prop_id ()) {
|
||||
auto path_ref = *shape->basic_ptr (db::object_with_properties<db::PathRef>::tag ());
|
||||
db::PathWithProperties path (path_ref.obj (), path_ref.properties_id ());
|
||||
path_with_properties_compressor.add (path, path_ref.trans ().disp ());
|
||||
} else {
|
||||
const db::PathRef &path_ref = *shape->basic_ptr (db::PathRef::tag ());
|
||||
path_compressor.add (path_ref.obj (), path_ref.trans ().disp ());
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case db::Shape::PathPtrArrayMember:
|
||||
|
||||
if (shape->has_prop_id ()) {
|
||||
auto path_ref = *shape->basic_ptr (db::object_with_properties<db::Shape::path_ptr_array_type>::tag ());
|
||||
db::PathWithProperties path (path_ref.object ().obj (), path_ref.properties_id ());
|
||||
path_with_properties_compressor.add (path, shape->array_trans ().disp ());
|
||||
} else {
|
||||
const db::Shape::path_ptr_array_type &path_ref = *shape->basic_ptr (db::Shape::path_ptr_array_type::tag ());
|
||||
path_compressor.add (path_ref.object ().obj (), shape->array_trans ().disp ());
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case db::Shape::Box:
|
||||
|
||||
if (shape->has_prop_id ()) {
|
||||
auto box = *shape->basic_ptr (db::BoxWithProperties::tag ());
|
||||
box_with_properties_compressor.add (box);
|
||||
} else {
|
||||
auto box = *shape->basic_ptr (db::Box::tag ());
|
||||
box_compressor.add (box);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case db::Shape::Point:
|
||||
|
||||
if (shape->has_prop_id ()) {
|
||||
auto point = *shape->basic_ptr (db::PointWithProperties::tag ());
|
||||
point_with_properties_compressor.add (point);
|
||||
} else {
|
||||
auto point = *shape->basic_ptr (db::Point::tag ());
|
||||
point_compressor.add (point);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case db::Shape::BoxArray:
|
||||
case db::Shape::BoxArrayMember:
|
||||
case db::Shape::ShortBox:
|
||||
case db::Shape::ShortBoxArrayMember:
|
||||
|
||||
if (shape->has_prop_id ()) {
|
||||
db::BoxWithProperties box;
|
||||
shape->instantiate (box);
|
||||
box.properties_id (shape->prop_id ());
|
||||
box_with_properties_compressor.add (box);
|
||||
} else {
|
||||
db::Box box;
|
||||
shape->instantiate (box);
|
||||
box_compressor.add (box);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case db::Shape::Text:
|
||||
|
||||
if (shape->has_prop_id ()) {
|
||||
auto text = *shape->basic_ptr (db::TextWithProperties::tag ());
|
||||
text_with_properties_compressor.add (text);
|
||||
} else {
|
||||
auto text = *shape->basic_ptr (db::Text::tag ());
|
||||
text_compressor.add (text);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case db::Shape::TextRef:
|
||||
|
||||
if (shape->has_prop_id ()) {
|
||||
auto text_ref = *shape->basic_ptr (db::object_with_properties<db::TextRef>::tag ());
|
||||
db::TextWithProperties text (text_ref.obj (), text_ref.properties_id ());
|
||||
text_with_properties_compressor.add (text, text_ref.trans ().disp ());
|
||||
} else {
|
||||
auto text_ref = *shape->basic_ptr (db::TextRef::tag ());
|
||||
text_compressor.add (text_ref.obj (), text_ref.trans ().disp ());
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case db::Shape::TextPtrArrayMember:
|
||||
|
||||
if (shape->has_prop_id ()) {
|
||||
auto text_ref = *shape->basic_ptr (db::object_with_properties<db::Shape::text_ptr_array_type>::tag ());
|
||||
db::TextWithProperties text (text_ref.object ().obj (), text_ref.properties_id ());
|
||||
text_with_properties_compressor.add (text, shape->array_trans ().disp ());
|
||||
} else {
|
||||
auto text_ref = *shape->basic_ptr (db::Shape::text_ptr_array_type::tag ());
|
||||
text_compressor.add (text_ref.object ().obj (), shape->array_trans ().disp ());
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case db::Shape::UserObject:
|
||||
// ignore.
|
||||
break;
|
||||
|
||||
default:
|
||||
tl_assert (false);
|
||||
}
|
||||
|
||||
++shape;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
path_compressor.flush (this);
|
||||
simple_polygon_compressor.flush (this);
|
||||
polygon_compressor.flush (this);
|
||||
edge_compressor.flush (this);
|
||||
edge_pair_compressor.flush (this);
|
||||
box_compressor.flush (this);
|
||||
point_compressor.flush (this);
|
||||
text_compressor.flush (this);
|
||||
|
||||
path_with_properties_compressor.flush (this);
|
||||
simple_polygon_with_properties_compressor.flush (this);
|
||||
polygon_with_properties_compressor.flush (this);
|
||||
edge_with_properties_compressor.flush (this);
|
||||
edge_pair_with_properties_compressor.flush (this);
|
||||
box_with_properties_compressor.flush (this);
|
||||
point_with_properties_compressor.flush (this);
|
||||
text_with_properties_compressor.flush (this);
|
||||
}
|
||||
|
||||
template <class Array>
|
||||
static db::Vector
|
||||
create_repetition_from_array (const Array *array, RegularArray ®ular, std::vector<db::Vector> &irregular_array)
|
||||
{
|
||||
db::Vector a, b;
|
||||
unsigned long na = 0, nb = 0;
|
||||
|
||||
if (array->is_iterated_array (&irregular_array)) {
|
||||
|
||||
// Take out the first displacement and move that to the shape and sort the displacements.
|
||||
// This way, sequences get normalized and there is a better chance of getting identical
|
||||
// repetition vectors.
|
||||
tl_assert (! irregular_array.empty ());
|
||||
db::Vector po = irregular_array.front ();
|
||||
std::vector<db::Vector>::iterator pw = irregular_array.begin();
|
||||
for (std::vector<db::Vector>::iterator p = pw + 1; p != irregular_array.end (); ++p) {
|
||||
*pw++ = *p - po;
|
||||
}
|
||||
irregular_array.erase (pw, irregular_array.end ());
|
||||
std::sort (irregular_array.begin (), irregular_array.end (), vector_cmp_x ());
|
||||
|
||||
return po;
|
||||
|
||||
} else if (array->is_regular_array (a, b, na, nb)) {
|
||||
|
||||
regular = RegularArray (a, b, size_t (na), size_t (nb));
|
||||
return db::Vector ();
|
||||
|
||||
} else {
|
||||
tl_assert (false);
|
||||
}
|
||||
}
|
||||
|
||||
db::Vector
|
||||
Compressed::create_repetition (const db::Shape &array_shape, RegularArray ®ular, std::vector<db::Vector> &irregular_array)
|
||||
{
|
||||
switch (array_shape.type ()) {
|
||||
case db::Shape::PolygonPtrArray:
|
||||
return create_repetition_from_array (array_shape.basic_ptr (db::Shape::polygon_ptr_array_type::tag ()), regular, irregular_array);
|
||||
case db::Shape::SimplePolygonPtrArray:
|
||||
return create_repetition_from_array (array_shape.basic_ptr (db::Shape::simple_polygon_ptr_array_type::tag ()), regular, irregular_array);
|
||||
case db::Shape::PathPtrArray:
|
||||
return create_repetition_from_array (array_shape.basic_ptr (db::Shape::path_ptr_array_type::tag ()), regular, irregular_array);
|
||||
case db::Shape::BoxArray:
|
||||
return create_repetition_from_array (array_shape.basic_ptr (db::Shape::box_array_type::tag ()), regular, irregular_array);
|
||||
case db::Shape::ShortBoxArray:
|
||||
return create_repetition_from_array (array_shape.basic_ptr (db::Shape::short_box_array_type::tag ()), regular, irregular_array);
|
||||
case db::Shape::TextPtrArray:
|
||||
return create_repetition_from_array (array_shape.basic_ptr (db::Shape::text_ptr_array_type::tag ()), regular, irregular_array);
|
||||
default:
|
||||
tl_assert (false);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
Compressed::compress_instances (const db::Cell::const_iterator &begin_instances, const std::set<db::cell_index_type> &cells_to_write, unsigned int level)
|
||||
{
|
||||
// use compression 0 for the instances - this preserves the arrays and does not create new ones, the
|
||||
// remaining ones are compressed into irregular arrays
|
||||
Compressor<db::CellInstArray> inst_compressor (0);
|
||||
Compressor<db::CellInstArrayWithProperties> inst_with_properties_compressor (0);
|
||||
|
||||
// Collect all instances
|
||||
for (auto inst_iterator = begin_instances; ! inst_iterator.at_end (); ++inst_iterator) {
|
||||
|
||||
if (cells_to_write.find (inst_iterator->cell_index ()) != cells_to_write.end ()) {
|
||||
|
||||
db::properties_id_type prop_id = inst_iterator->prop_id ();
|
||||
db::CellInstArray inst_array = inst_iterator->cell_inst ();
|
||||
|
||||
if (level == 0 || inst_array.size () > 1) {
|
||||
|
||||
// Recode the instance array into a regular array or irregular array spec (the latter hardly used) and
|
||||
// a single instance.
|
||||
RegularArray array;
|
||||
std::vector<db::Vector> irregular_array;
|
||||
|
||||
db::Vector disp;
|
||||
bool transfer_array = (inst_array.size () > 1 && level > 0);
|
||||
if (transfer_array) {
|
||||
disp = create_repetition_from_array (&inst_array, array, irregular_array);
|
||||
}
|
||||
|
||||
db::CellInstArray single_inst;
|
||||
if (! inst_array.is_complex ()) {
|
||||
single_inst = db::CellInstArray (inst_array.object (), db::Trans (-disp) * inst_array.front ());
|
||||
} else {
|
||||
single_inst = db::CellInstArray (inst_array.object (), inst_array.complex_trans (db::Trans (-disp) * inst_array.front ()));
|
||||
}
|
||||
|
||||
// no compression -> just keep as is
|
||||
if (prop_id != 0) {
|
||||
write (db::CellInstArrayWithProperties (single_inst, prop_id), array, irregular_array);
|
||||
} else {
|
||||
write (single_inst, array, irregular_array);
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
// We have a single instance: reduce by displacement and compress into enumerated (irregular) arrays.
|
||||
// As we configured the compressor with level 0, no regular array formation will happen here. This is
|
||||
// good for instances as array instances are special.
|
||||
db::Vector disp = inst_array.front ().disp ();
|
||||
|
||||
db::CellInstArray single_inst;
|
||||
if (! inst_array.is_complex ()) {
|
||||
single_inst = db::CellInstArray (inst_array.object (), db::Trans (-disp) * inst_array.front ());
|
||||
} else {
|
||||
single_inst = db::CellInstArray (inst_array.object (), inst_array.complex_trans (db::Trans (-disp) * inst_array.front ()));
|
||||
}
|
||||
|
||||
if (prop_id != 0) {
|
||||
inst_with_properties_compressor.add (db::CellInstArrayWithProperties (single_inst, prop_id), disp);
|
||||
} else {
|
||||
inst_compressor.add (single_inst, disp);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
inst_compressor.flush (this);
|
||||
inst_with_properties_compressor.flush (this);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,295 @@
|
|||
|
||||
/*
|
||||
|
||||
KLayout Layout Viewer
|
||||
Copyright (C) 2006-2025 Matthias Koefferlein
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
*/
|
||||
|
||||
#ifndef HDR_lstrCompressed
|
||||
#define HDR_lstrCompressed
|
||||
|
||||
#include "lstrCompressor.h"
|
||||
|
||||
#include "dbVector.h"
|
||||
#include "dbBox.h"
|
||||
#include "dbPath.h"
|
||||
#include "dbEdge.h"
|
||||
#include "dbEdgePair.h"
|
||||
#include "dbPolygon.h"
|
||||
#include "dbText.h"
|
||||
#include "dbObjectWithProperties.h"
|
||||
#include "dbCell.h"
|
||||
|
||||
#include <map>
|
||||
#include <vector>
|
||||
|
||||
namespace lstr
|
||||
{
|
||||
|
||||
/**
|
||||
* @brief A container for storing objects and compressing them using regular or irregular repetitions
|
||||
*
|
||||
* Use this object to compress db::Shapes or db::Instances containers.
|
||||
* Use "Compressed::compress_shapes" to compress a Shapes container and
|
||||
* "Compressed::compress_instances" to compress an Instances container.
|
||||
*
|
||||
* After feeding the objects to be compressed using one of these methods,
|
||||
* you can access the compressed objects using "Compressed::get_container".
|
||||
* These containers are separated by objects and carray plain objects
|
||||
* (no compression), plain objects with properties (no compression either),
|
||||
* array objects (object that have been compressed into regular or irregular
|
||||
* arrays) and array objects with properties (the same, but also with
|
||||
* properties).
|
||||
*
|
||||
* During compression, arrays are formed. The array definitions are kept
|
||||
* in two lists: regular arrays and irregular (iterated or enumerated)
|
||||
* arrays. The former can be obtained using "Compressed::begin/end_regular_arrays",
|
||||
* the latter using "Compressed::begin/end_irregular_arrays".
|
||||
* The total number of array objects can be obtained using
|
||||
* "Compressed::num_arrays".
|
||||
*/
|
||||
class Compressed
|
||||
: public CompressorDelivery
|
||||
{
|
||||
public:
|
||||
|
||||
/**
|
||||
* @brief Represents compressed objects
|
||||
*
|
||||
* "plain" is a list of plain objects - those which have not been
|
||||
* compressed.
|
||||
*
|
||||
* "with_properties" is a list of pairs of objects and properties
|
||||
* Id. The properties Id is a concept from the db namespace and
|
||||
* represents a property set by some opaque identifier.
|
||||
*
|
||||
* "array" is a list of pairs of objects and repetition specifications.
|
||||
* The repetition is specified through an index (a uint64_t value).
|
||||
* The index is given by the second value when you iterate the repetitions
|
||||
* in "Compressed::begin_regular_arrays" or "Compressed::begin_irregular_arrays".
|
||||
*
|
||||
* "array_with_properties" is a list of pairs or pairs: "first.first"
|
||||
* is the object, "first.second" the properties Id and "second" the
|
||||
* repetition index (see "array").
|
||||
*/
|
||||
template <class Obj>
|
||||
struct compressed_container
|
||||
{
|
||||
std::list<Obj> plain;
|
||||
std::list<std::pair<Obj, db::properties_id_type> > with_properties;
|
||||
std::list<std::pair<Obj, uint64_t> > array;
|
||||
std::list<std::pair<std::pair<Obj, db::properties_id_type>, uint64_t> > array_with_properties;
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Constructor
|
||||
*
|
||||
* Note that you need to create a fresh object to compress
|
||||
* instances are shapes. There is no "clear" or "restart" method.
|
||||
*/
|
||||
Compressed ();
|
||||
|
||||
/**
|
||||
* @brief Compresses a shape container
|
||||
*
|
||||
* This method should be called on a fresh Compressed object only.
|
||||
*
|
||||
* @param shapes The shapes container to compress
|
||||
* @param level Compression level (see below)
|
||||
* @param recompress Indicates where to recompress (see below)
|
||||
*
|
||||
* "level" is a value the indicates the compression effort made for forming
|
||||
* regular arrays. A value of "0" indicates that no arrays will be formed.
|
||||
* "2" indicates "reasonable effort" to form arrays. Roughly, the value indicates
|
||||
* how many neighbors to investigate for forming arrays.
|
||||
*
|
||||
* If "recompress" is true, existing arrays will be exploded and fed into
|
||||
* the compression algorithm again. If false, they will be maintained.
|
||||
*/
|
||||
void compress_shapes (const db::Shapes &shapes, unsigned int level, bool recompress);
|
||||
|
||||
/**
|
||||
* @brief Compresses instances
|
||||
*
|
||||
* This method should be called on a fresh Compressed object only.
|
||||
*
|
||||
* @param begin_instances The instance iterator specifying the instances to compress
|
||||
* @param cells_to_write A filter specifying the cells to write
|
||||
* @param level Compression level (see "compress_shapes")
|
||||
*
|
||||
* "Cell::begin" can be used to generate the value for "instance_iterator".
|
||||
*
|
||||
* Instances for cells not in "cells_to_write" are not generated.
|
||||
*/
|
||||
void compress_instances (const db::Cell::const_iterator &begin_instances, const std::set<db::cell_index_type> &cells_to_write, unsigned int level);
|
||||
|
||||
/**
|
||||
* @brief Gets the compressed objects for a given object type
|
||||
*
|
||||
* Object types can be "db::Box", "db::Edge", "db::EdgePair",
|
||||
* "db::Polygon", "db::SimplePolygon", "db::Path" or "db::Text"
|
||||
* for Shapes and "db::CellInstArray" for instances.
|
||||
*
|
||||
* For "db::CellInstArray", the objects will be single instances
|
||||
* and the array nature is reflected by the repetition type.
|
||||
*
|
||||
* Note that either "compress_shapes" or "compress_instances" has
|
||||
* to be called before the container is available.
|
||||
*/
|
||||
template <class Obj> compressed_container<Obj> &get_container ();
|
||||
|
||||
/**
|
||||
* @brief begin iterator for the regular arrays
|
||||
*
|
||||
* The iterator delivers a pair of regular array specifications and
|
||||
* an index. The array specification is a RegularArray object that
|
||||
* specifies the array axes, pitches and array dimensions.
|
||||
*
|
||||
* The second value is the repetition index, by which the compressed
|
||||
* objects refer to that array.
|
||||
*
|
||||
* Note that either "compress_shapes" or "compress_instances" has
|
||||
* to be called before the arrays are available.
|
||||
*/
|
||||
std::map<RegularArray, uint64_t>::const_iterator begin_regular_arrays () const { return m_array_to_rep_id.begin (); }
|
||||
|
||||
/**
|
||||
* @brief end iterator for the regular arrays
|
||||
*/
|
||||
std::map<RegularArray, uint64_t>::const_iterator end_regular_arrays () const { return m_array_to_rep_id.end (); }
|
||||
|
||||
/**
|
||||
* @brief begin iterator for the irregular arrays
|
||||
*
|
||||
* The iterator delivers a pair of irregular array specifications and
|
||||
* an index. The array specification is a list of displacements that
|
||||
* specify the placements of the object.
|
||||
*
|
||||
* The second value is the repetition index, by which the compressed
|
||||
* objects refer to that array.
|
||||
*
|
||||
* Note that either "compress_shapes" or "compress_instances" has
|
||||
* to be called before the arrays are available.
|
||||
*/
|
||||
std::map<std::vector<db::Vector>, uint64_t>::const_iterator begin_irregular_arrays () const { return m_irregular_to_rep_id.begin (); }
|
||||
|
||||
/**
|
||||
* @brief end iterator for the irregular arrays
|
||||
*/
|
||||
std::map<std::vector<db::Vector>, uint64_t>::const_iterator end_irregular_arrays () const { return m_irregular_to_rep_id.end (); }
|
||||
|
||||
/**
|
||||
* @brief Gets the total number of arrays stored in this object
|
||||
*
|
||||
* Note that either "compress_shapes" or "compress_instances" has
|
||||
* to be called before the arrays are available.
|
||||
*/
|
||||
size_t num_arrays () const
|
||||
{
|
||||
return m_array_to_rep_id.size () + m_irregular_to_rep_id.size ();
|
||||
}
|
||||
|
||||
protected:
|
||||
virtual void write (const db::Point &obj, const RegularArray &array, const disp_vector &irregular) { store (obj, array, irregular); }
|
||||
virtual void write (const db::PointWithProperties &obj, const RegularArray &array, const disp_vector &irregular) { store (obj, array, irregular); }
|
||||
virtual void write (const db::Box &obj, const RegularArray &array, const disp_vector &irregular) { store (obj, array, irregular); }
|
||||
virtual void write (const db::BoxWithProperties &obj, const RegularArray &array, const disp_vector &irregular) { store (obj, array, irregular); }
|
||||
virtual void write (const db::Edge &obj, const RegularArray &array, const disp_vector &irregular) { store (obj, array, irregular); }
|
||||
virtual void write (const db::EdgeWithProperties &obj, const RegularArray &array, const disp_vector &irregular) { store (obj, array, irregular); }
|
||||
virtual void write (const db::EdgePair &obj, const RegularArray &array, const disp_vector &irregular) { store (obj, array, irregular); }
|
||||
virtual void write (const db::EdgePairWithProperties &obj, const RegularArray &array, const disp_vector &irregular) { store (obj, array, irregular); }
|
||||
virtual void write (const db::Polygon &obj, const RegularArray &array, const disp_vector &irregular) { store (obj, array, irregular); }
|
||||
virtual void write (const db::PolygonWithProperties &obj, const RegularArray &array, const disp_vector &irregular) { store (obj, array, irregular); }
|
||||
virtual void write (const db::SimplePolygon &obj, const RegularArray &array, const disp_vector &irregular) { store (obj, array, irregular); }
|
||||
virtual void write (const db::SimplePolygonWithProperties &obj, const RegularArray &array, const disp_vector &irregular) { store (obj, array, irregular); }
|
||||
virtual void write (const db::Path &obj, const RegularArray &array, const disp_vector &irregular) { store (obj, array, irregular); }
|
||||
virtual void write (const db::PathWithProperties &obj, const RegularArray &array, const disp_vector &irregular) { store (obj, array, irregular); }
|
||||
virtual void write (const db::Text &obj, const RegularArray &array, const disp_vector &irregular) { store (obj, array, irregular); }
|
||||
virtual void write (const db::TextWithProperties &obj, const RegularArray &array, const disp_vector &irregular) { store (obj, array, irregular); }
|
||||
virtual void write (const db::CellInstArray &obj, const RegularArray &array, const disp_vector &irregular) { store (obj, array, irregular); }
|
||||
virtual void write (const db::CellInstArrayWithProperties &obj, const RegularArray &array, const disp_vector &irregular) { store (obj, array, irregular); }
|
||||
|
||||
private:
|
||||
compressed_container<db::Point> m_points;
|
||||
compressed_container<db::Box> m_boxes;
|
||||
compressed_container<db::Edge> m_edges;
|
||||
compressed_container<db::EdgePair> m_edge_pairs;
|
||||
compressed_container<db::Path> m_paths;
|
||||
compressed_container<db::Polygon> m_polygons;
|
||||
compressed_container<db::SimplePolygon> m_simple_polygons;
|
||||
compressed_container<db::Text> m_texts;
|
||||
compressed_container<db::CellInstArray> m_instances;
|
||||
|
||||
template <class Obj>
|
||||
void store_no_props (const Obj &obj, const RegularArray &array, const std::vector<db::Vector> &irregular)
|
||||
{
|
||||
compressed_container<Obj> &cont = get_container<Obj> ();
|
||||
if (array.is_null () && irregular.empty ()) {
|
||||
cont.plain.push_back (obj);
|
||||
} else {
|
||||
cont.array.push_back (std::make_pair (obj, make_rep_id (array, irregular)));
|
||||
}
|
||||
}
|
||||
|
||||
template <class Obj>
|
||||
void store (const Obj &obj, const RegularArray &array, const std::vector<db::Vector> &irregular)
|
||||
{
|
||||
store_no_props (obj, array, irregular);
|
||||
}
|
||||
|
||||
template <class Obj>
|
||||
void store (const db::object_with_properties<Obj> &obj, const RegularArray &array, const std::vector<db::Vector> &irregular)
|
||||
{
|
||||
compressed_container<Obj> &cont = get_container<Obj> ();
|
||||
if (obj.properties_id () == 0) {
|
||||
store_no_props<Obj> (obj, array, irregular);
|
||||
} else {
|
||||
if (array.is_null () && irregular.empty ()) {
|
||||
cont.with_properties.push_back (std::pair<Obj, db::properties_id_type> (obj, obj.properties_id ()));
|
||||
} else {
|
||||
cont.array_with_properties.push_back (std::make_pair (std::pair<Obj, db::properties_id_type> (obj, obj.properties_id ()), make_rep_id (array, irregular)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
size_t m_next_id;
|
||||
std::map<RegularArray, uint64_t> m_array_to_rep_id;
|
||||
std::map<std::vector<db::Vector>, uint64_t> m_irregular_to_rep_id;
|
||||
|
||||
uint64_t make_rep_id (const RegularArray &array, const std::vector<db::Vector> &irregular);
|
||||
db::Vector create_repetition (const db::Shape &array, RegularArray ®ular, std::vector<db::Vector> &irregular_array);
|
||||
template <class Obj>
|
||||
void write_shape(const db::Shape &shape, RegularArray ®ular, std::vector<db::Vector> &irregular_array);
|
||||
template <class Obj>
|
||||
void write_shape(const db::Shape &shape, const db::Vector &disp, RegularArray ®ular, std::vector<db::Vector> &irregular_array);
|
||||
};
|
||||
|
||||
template <> inline Compressed::compressed_container<db::Point> &Compressed::get_container () { return m_points; }
|
||||
template <> inline Compressed::compressed_container<db::Box> &Compressed::get_container () { return m_boxes; }
|
||||
template <> inline Compressed::compressed_container<db::Edge> &Compressed::get_container () { return m_edges; }
|
||||
template <> inline Compressed::compressed_container<db::EdgePair> &Compressed::get_container () { return m_edge_pairs; }
|
||||
template <> inline Compressed::compressed_container<db::Path> &Compressed::get_container () { return m_paths; }
|
||||
template <> inline Compressed::compressed_container<db::Polygon> &Compressed::get_container () { return m_polygons; }
|
||||
template <> inline Compressed::compressed_container<db::SimplePolygon> &Compressed::get_container () { return m_simple_polygons; }
|
||||
template <> inline Compressed::compressed_container<db::Text> &Compressed::get_container () { return m_texts; }
|
||||
template <> inline Compressed::compressed_container<db::CellInstArray> &Compressed::get_container () { return m_instances; }
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
|
@ -0,0 +1,405 @@
|
|||
|
||||
/*
|
||||
|
||||
KLayout Layout Viewer
|
||||
Copyright (C) 2006-2025 Matthias Koefferlein
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
*/
|
||||
|
||||
#include "lstrCompressor.h"
|
||||
|
||||
#include "dbPluginCommon.h"
|
||||
#include "dbHash.h"
|
||||
|
||||
namespace lstr
|
||||
{
|
||||
|
||||
// ---------------------------------------------------------------------------------
|
||||
// Utilities that prevent signed coordinate overflow
|
||||
|
||||
template <class R>
|
||||
inline R safe_scale (double sf, R value)
|
||||
{
|
||||
double i = floor (sf * value + 0.5);
|
||||
if (i < double (std::numeric_limits<R>::min ())) {
|
||||
throw tl::Exception ("Scaling failed: coordinate underflow");
|
||||
}
|
||||
if (i > double (std::numeric_limits<R>::max ())) {
|
||||
throw tl::Exception ("Scaling failed: coordinate overflow");
|
||||
}
|
||||
return R (i);
|
||||
}
|
||||
|
||||
template <class R>
|
||||
inline R safe_diff (R a, R b)
|
||||
{
|
||||
R d = a - b;
|
||||
if ((a > b && d < 0) || (a < b && d > 0)) {
|
||||
throw tl::Exception ("Signed coordinate difference overflow");
|
||||
}
|
||||
return d;
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------------
|
||||
|
||||
template <class Obj>
|
||||
void
|
||||
Compressor<Obj>::flush (CompressorDelivery *writer)
|
||||
{
|
||||
// produce the repetitions
|
||||
|
||||
std::vector<db::Vector> empty_irregular;
|
||||
RegularArray empty_regular;
|
||||
|
||||
disp_vector displacements;
|
||||
typedef std::vector <std::pair <db::Vector, std::pair <db::Coord, int> > > tmp_rep_vector;
|
||||
tmp_rep_vector repetitions;
|
||||
std::vector<std::pair<db::Vector, RegularArray> > rep_vector;
|
||||
|
||||
for (auto n = m_normalized.begin (); n != m_normalized.end (); ++n) {
|
||||
|
||||
rep_vector.clear ();
|
||||
|
||||
// don't compress below a threshold of 10 shapes
|
||||
if (m_level < 1 || n->second.size () < 10) {
|
||||
|
||||
// Simple compression: just sort and make irregular repetitions
|
||||
std::sort (n->second.begin (), n->second.end (), vector_cmp_x ());
|
||||
|
||||
} else {
|
||||
|
||||
disp_vector::iterator d;
|
||||
tmp_rep_vector::iterator rw;
|
||||
|
||||
std::unordered_set<db::Coord> xcoords, ycoords;
|
||||
if (m_level > 1) {
|
||||
for (d = n->second.begin (); d != n->second.end (); ++d) {
|
||||
xcoords.insert (d->x ());
|
||||
ycoords.insert (d->y ());
|
||||
}
|
||||
}
|
||||
|
||||
bool xfirst = xcoords.size () < ycoords.size ();
|
||||
|
||||
double simple_rep_cost = 0;
|
||||
double array_cost = 0;
|
||||
|
||||
// Try single-point compression to repetitions in the x and y direction. For the first
|
||||
// direction, use the one with more distinct values. For this, a better compression is
|
||||
// expected.
|
||||
for (int xypass = 0; xypass <= 1; ++xypass) {
|
||||
|
||||
bool xrep = (xfirst == (xypass == 0));
|
||||
|
||||
displacements.clear ();
|
||||
repetitions.clear ();
|
||||
|
||||
displacements.swap (n->second);
|
||||
if (xrep) {
|
||||
std::sort (displacements.begin (), displacements.end (), vector_cmp_x ());
|
||||
} else {
|
||||
std::sort (displacements.begin (), displacements.end (), vector_cmp_y ());
|
||||
}
|
||||
|
||||
if (xypass == 0 && m_level > 1) {
|
||||
// Establish a baseline for the repetition cost
|
||||
simple_rep_cost += cost_of (displacements.front ().x ()) + cost_of (displacements.front ().y ());
|
||||
for (d = displacements.begin () + 1; d != displacements.end (); ++d) {
|
||||
simple_rep_cost += std::max (1.0, cost_of (double (d->x ()) - double (d[-1].x ())) + cost_of (double (d->y ()) - double (d[-1].y ())));
|
||||
}
|
||||
}
|
||||
|
||||
disp_vector::iterator dwindow = displacements.begin ();
|
||||
for (d = displacements.begin (); d != displacements.end (); ) {
|
||||
|
||||
if (m_level < 2) {
|
||||
|
||||
disp_vector::iterator dd = d;
|
||||
++dd;
|
||||
|
||||
db::Vector dxy;
|
||||
int nxy = 1;
|
||||
|
||||
if (dd != displacements.end ()) {
|
||||
|
||||
dxy = xrep ? db::Vector (safe_diff (dd->x (), d->x ()), 0) : db::Vector (0, safe_diff (dd->y (), d->y ()));
|
||||
while (dd != displacements.end () && *dd == dd[-1] + dxy) {
|
||||
++dd;
|
||||
++nxy;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// Note in level 1 optimization, no cost estimation is done, hence small arrays won't be removed.
|
||||
// To compensate that, we use a minimum size of 3 items per array.
|
||||
if (nxy < 3) {
|
||||
|
||||
n->second.push_back (*d++);
|
||||
|
||||
} else {
|
||||
|
||||
repetitions.push_back (std::make_pair (*d, std::make_pair (xrep ? dxy.x () : dxy.y (), nxy)));
|
||||
d = dd;
|
||||
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
// collect the nearest neighbor distances and counts for 2..level order neighbors
|
||||
int nxy_max = 1;
|
||||
unsigned int nn_max = 0;
|
||||
|
||||
// move the window of identical x/y coordinates if necessary
|
||||
if (d == dwindow) {
|
||||
for (dwindow = d + 1; dwindow != displacements.end () && (xrep ? (dwindow->y () == d->y ()) : (dwindow->x () == d->x ())); ++dwindow)
|
||||
;
|
||||
}
|
||||
|
||||
for (unsigned int nn = 0; nn < m_level; ++nn) {
|
||||
|
||||
disp_vector::iterator dd = d + (nn + 1);
|
||||
if (dd >= dwindow) {
|
||||
break;
|
||||
}
|
||||
|
||||
db::Vector dxy = xrep ? db::Vector (safe_diff (dd->x (), d->x ()), 0) : db::Vector (0, safe_diff (dd->y (), d->y ()));
|
||||
|
||||
int nxy = 2;
|
||||
while (dd != dwindow) {
|
||||
disp_vector::iterator df = std::lower_bound (dd + 1, dwindow, *dd + dxy);
|
||||
if (df == dwindow || *df != *dd + dxy) {
|
||||
break;
|
||||
}
|
||||
++nxy;
|
||||
dd = df;
|
||||
}
|
||||
|
||||
if (nxy > nxy_max) {
|
||||
nxy_max = nxy;
|
||||
nn_max = nn;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (nxy_max < 2) {
|
||||
|
||||
// no candidate found - just keep that one
|
||||
n->second.push_back (*d++);
|
||||
|
||||
} else {
|
||||
|
||||
// take out the ones of this sequence from the list
|
||||
db::Vector dxy_max = xrep ? db::Vector (safe_diff ((d + nn_max + 1)->x (), d->x ()), 0) : db::Vector (0, safe_diff ((d + nn_max + 1)->y (), d->y ()));
|
||||
|
||||
disp_vector::iterator ds = dwindow;
|
||||
disp_vector::iterator dt = dwindow;
|
||||
db::Vector df = *d + dxy_max * long (nxy_max - 1);
|
||||
|
||||
do {
|
||||
--ds;
|
||||
if (*ds != df) {
|
||||
*--dt = *ds;
|
||||
} else {
|
||||
df -= dxy_max;
|
||||
}
|
||||
} while (ds != d);
|
||||
|
||||
repetitions.push_back (std::make_pair (*d, std::make_pair (xrep ? dxy_max.x () : dxy_max.y (), nxy_max)));
|
||||
|
||||
d = dt;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// Apply some heuristic criterion that allows the algorithm to determine whether it's worth doing the compression
|
||||
|
||||
// Try to compact these repetitions further, y direction first, then x direction
|
||||
for (int xypass2 = 1; xypass2 >= 0; --xypass2) {
|
||||
|
||||
if (xypass2) {
|
||||
std::sort (repetitions.begin (), repetitions.end (), rep_vector_cmp<vector_cmp_y> ());
|
||||
} else {
|
||||
std::sort (repetitions.begin (), repetitions.end (), rep_vector_cmp<vector_cmp_x> ());
|
||||
}
|
||||
|
||||
rw = repetitions.begin ();
|
||||
for (auto r = repetitions.begin (); r != repetitions.end (); ) {
|
||||
|
||||
auto rr = r;
|
||||
++rr;
|
||||
|
||||
db::Vector dxy2;
|
||||
if (rr != repetitions.end ()) {
|
||||
dxy2 = xypass2 ? db::Vector (0, safe_diff (rr->first.y (), r->first.y ())) : db::Vector (safe_diff (rr->first.x (), r->first.x ()), 0);
|
||||
}
|
||||
int nxy2 = 1;
|
||||
|
||||
db::Vector dxy2n (dxy2);
|
||||
while (rr != repetitions.end () && rr->second == r->second && rr->first == r->first + dxy2n) {
|
||||
++nxy2;
|
||||
++rr;
|
||||
dxy2n += dxy2;
|
||||
}
|
||||
|
||||
if (nxy2 < 2 && xypass2) {
|
||||
*rw++ = *r;
|
||||
} else {
|
||||
if (m_level < 2) {
|
||||
Obj obj = n->first;
|
||||
obj.move (r->first);
|
||||
db::Vector a (xrep ? r->second.first : 0, xrep ? 0 : r->second.first);
|
||||
writer->write (obj, RegularArray (a, dxy2, r->second.second, nxy2), empty_irregular);
|
||||
} else {
|
||||
db::Vector a (xrep ? r->second.first : 0, xrep ? 0 : r->second.first);
|
||||
rep_vector.push_back (std::make_pair (r->first, RegularArray (a, dxy2, r->second.second, nxy2)));
|
||||
}
|
||||
}
|
||||
|
||||
r = rr;
|
||||
|
||||
}
|
||||
|
||||
repetitions.erase (rw, repetitions.end ());
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (m_level > 1) {
|
||||
|
||||
// Compute a cost for the repetitions
|
||||
|
||||
if (! n->second.empty ()) {
|
||||
// irregular repetition contribution
|
||||
array_cost += cost_of (n->second.front ().x ()) + cost_of (n->second.front ().y ());
|
||||
for (auto d = n->second.begin () + 1; d != n->second.end (); ++d) {
|
||||
array_cost += std::max(1.0, cost_of (d->x () - d[-1].x ()) + cost_of (d->y () - d[-1].y ()));
|
||||
}
|
||||
}
|
||||
|
||||
bool array_set = false;
|
||||
db::Vector a_ref, b_ref;
|
||||
size_t in_ref = 0, im_ref = 0;
|
||||
bool ref_set = false;
|
||||
db::Coord x_ref = 0, y_ref = 0;
|
||||
|
||||
for (auto r = rep_vector.begin (); r != rep_vector.end (); ++r) {
|
||||
|
||||
db::Vector a, b;
|
||||
size_t in = 0, im = 0;
|
||||
|
||||
array_cost += 2; // two bytes for the shape
|
||||
|
||||
// The cost of the first point (takes into account compression by reuse of one coordinate)
|
||||
if (!ref_set || x_ref != r->first.x ()) {
|
||||
array_cost += cost_of (r->first.x ());
|
||||
}
|
||||
if (!ref_set || y_ref != r->first.y ()) {
|
||||
array_cost += cost_of (r->first.y ());
|
||||
}
|
||||
ref_set = true;
|
||||
x_ref = r->first.x ();
|
||||
y_ref = r->first.y ();
|
||||
|
||||
// Cost of the repetition (takes into account reuse)
|
||||
if (! array_set || a != a_ref || b != b_ref || in != in_ref || im != im_ref) {
|
||||
array_set = true;
|
||||
a_ref = a;
|
||||
b_ref = b;
|
||||
in_ref = in;
|
||||
im_ref = im;
|
||||
array_cost += cost_of (a.x ()) + cost_of (b.x ()) + cost_of (a.y ()) + cost_of (b.y ()) + cost_of (in) + cost_of (im);
|
||||
} else {
|
||||
array_cost += 1; // one byte
|
||||
}
|
||||
|
||||
// Note: the pointlist is reused, hence does not contribute
|
||||
|
||||
}
|
||||
|
||||
// And resolve the repetitions if it does not make sense to keep them
|
||||
if (array_cost > simple_rep_cost) {
|
||||
for (auto r = rep_vector.begin (); r != rep_vector.end (); ++r) {
|
||||
for (size_t ia = 0; ia < r->second.na (); ++ia) {
|
||||
for (size_t ib = 0; ib < r->second.nb (); ++ib) {
|
||||
n->second.push_back (r->first + r->second.a () * long (ia) + r->second.b () * long (ib));
|
||||
}
|
||||
}
|
||||
}
|
||||
rep_vector.clear ();
|
||||
std::sort (n->second.begin (), n->second.end (), vector_cmp_x ());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
for (auto r = rep_vector.begin (); r != rep_vector.end (); ++r) {
|
||||
Obj obj = n->first;
|
||||
obj.move (r->first);
|
||||
writer->write (obj, r->second, empty_irregular);
|
||||
}
|
||||
|
||||
if (n->second.size () > 1) {
|
||||
|
||||
// need to normalize?
|
||||
db::Vector p0 = n->second.front ();
|
||||
std::vector<db::Vector>::iterator pw = n->second.begin();
|
||||
for (auto p = pw + 1; p != n->second.end (); ++p) {
|
||||
*pw++ = *p - p0;
|
||||
}
|
||||
n->second.erase (pw, n->second.end ());
|
||||
|
||||
Obj obj = n->first;
|
||||
obj.move (p0);
|
||||
writer->write (obj, empty_regular, n->second);
|
||||
|
||||
} else if (! n->second.empty ()) {
|
||||
|
||||
Obj obj = n->first;
|
||||
obj.move (n->second.front ());
|
||||
writer->write (obj, empty_regular, empty_irregular);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
// explicit instantiations
|
||||
template class Compressor<db::Point>;
|
||||
template class Compressor<db::PointWithProperties>;
|
||||
template class Compressor<db::Box>;
|
||||
template class Compressor<db::BoxWithProperties>;
|
||||
template class Compressor<db::Edge>;
|
||||
template class Compressor<db::EdgeWithProperties>;
|
||||
template class Compressor<db::EdgePair>;
|
||||
template class Compressor<db::EdgePairWithProperties>;
|
||||
template class Compressor<db::Polygon>;
|
||||
template class Compressor<db::PolygonWithProperties>;
|
||||
template class Compressor<db::SimplePolygon>;
|
||||
template class Compressor<db::SimplePolygonWithProperties>;
|
||||
template class Compressor<db::Text>;
|
||||
template class Compressor<db::TextWithProperties>;
|
||||
template class Compressor<db::Path>;
|
||||
template class Compressor<db::PathWithProperties>;
|
||||
template class Compressor<db::CellInstArray>;
|
||||
template class Compressor<db::CellInstArrayWithProperties>;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,422 @@
|
|||
|
||||
/*
|
||||
|
||||
KLayout Layout Viewer
|
||||
Copyright (C) 2006-2025 Matthias Koefferlein
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
*/
|
||||
|
||||
#ifndef HDR_lstrCompressor
|
||||
#define HDR_lstrCompressor
|
||||
|
||||
#include "dbVector.h"
|
||||
#include "dbBox.h"
|
||||
#include "dbPath.h"
|
||||
#include "dbEdge.h"
|
||||
#include "dbEdgePair.h"
|
||||
#include "dbPolygon.h"
|
||||
#include "dbText.h"
|
||||
#include "dbInstances.h"
|
||||
#include "dbObjectWithProperties.h"
|
||||
|
||||
#include <unordered_map>
|
||||
#include <vector>
|
||||
|
||||
namespace lstr
|
||||
{
|
||||
|
||||
const unsigned int max_lstreame_compression_level = 10;
|
||||
|
||||
/**
|
||||
* @brief Compare operator for points, distinct x clustered (with same y)
|
||||
*/
|
||||
struct vector_cmp_x
|
||||
{
|
||||
bool operator() (const db::Vector &a, const db::Vector &b) const
|
||||
{
|
||||
if (a.y () != b.y ()) {
|
||||
return a.y () < b.y ();
|
||||
} else {
|
||||
return a.x () < b.x ();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Compare operator for points, distinct y clustered (with same x)
|
||||
*/
|
||||
struct vector_cmp_y
|
||||
{
|
||||
bool operator() (const db::Vector &a, const db::Vector &b) const
|
||||
{
|
||||
if (a.x () != b.x ()) {
|
||||
return a.x () < b.x ();
|
||||
} else {
|
||||
return a.y () < b.y ();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Returns the cost value of a coordinate difference (or coordinate)
|
||||
* The cost is used to estimate the size cost of a coordinate difference
|
||||
* in the OASIS output.
|
||||
* The cost is roughly the number of bytes required to represent the
|
||||
* number. It does not consider gdelta compression, actual byte count or similar.
|
||||
*
|
||||
* TODO: this heuristics is taken from OASIS. I should be adapted to LStream.
|
||||
*/
|
||||
inline double cost_of (double d)
|
||||
{
|
||||
int exp = 0;
|
||||
frexp (d, &exp);
|
||||
return double ((exp + 7) / 8);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief A predicate describing whether an object is empty
|
||||
*
|
||||
* An object is "empty", if it does not have at least one reference point.
|
||||
* For example, an empty box is empty. Such objects cannot be written and are
|
||||
* stripped.
|
||||
*/
|
||||
template <class Object>
|
||||
static inline bool object_is_empty (const Object &) { return false; }
|
||||
static inline bool object_is_empty (const db::Box &object) { return object.empty (); }
|
||||
static inline bool object_is_empty (const db::Polygon &object) { return object.hull ().begin () == object.hull ().end (); }
|
||||
static inline bool object_is_empty (const db::SimplePolygon &object) { return object.hull ().begin () == object.hull ().end (); }
|
||||
static inline bool object_is_empty (const db::Path &object) { return object.begin () == object.end (); }
|
||||
|
||||
/**
|
||||
* @brief Normalization of the position of an object
|
||||
*/
|
||||
template <class Object>
|
||||
static inline db::Vector reduce_object (Object &object)
|
||||
{
|
||||
db::Disp tr;
|
||||
object.reduce (tr);
|
||||
return tr.disp ();
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Specialization for EdgePair which currently does not have "reduce"
|
||||
*/
|
||||
static inline db::Vector reduce_object_edge_pair (db::EdgePair &ep)
|
||||
{
|
||||
db::EdgePair::vector_type d (ep.first ().p1 ());
|
||||
ep.move (-d);
|
||||
return d;
|
||||
}
|
||||
|
||||
static inline db::Vector reduce_object (db::EdgePair &ep)
|
||||
{
|
||||
return reduce_object_edge_pair (ep);
|
||||
}
|
||||
|
||||
static inline db::Vector reduce_object (db::EdgePairWithProperties &ep)
|
||||
{
|
||||
return reduce_object_edge_pair (ep);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Specialization for EdgePair which currently does not have "reduce"
|
||||
*/
|
||||
static inline db::Vector reduce_object_point (db::Point &pt)
|
||||
{
|
||||
db::Vector d = db::Vector (pt);
|
||||
pt = db::Point ();
|
||||
return d;
|
||||
}
|
||||
|
||||
static inline db::Vector reduce_object (db::Point &pt)
|
||||
{
|
||||
return reduce_object_point (pt);
|
||||
}
|
||||
|
||||
static inline db::Vector reduce_object (db::PointWithProperties &pt)
|
||||
{
|
||||
return reduce_object_point (pt);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Specialization for CellInstArray
|
||||
*/
|
||||
static inline db::Vector reduce_object_cell_inst_array (db::CellInstArray &ci)
|
||||
{
|
||||
db::Vector d = ci.front ().disp ();
|
||||
ci.move (-d);
|
||||
return d;
|
||||
}
|
||||
|
||||
static inline db::Vector reduce_object (db::CellInstArray &ci)
|
||||
{
|
||||
return reduce_object_cell_inst_array (ci);
|
||||
}
|
||||
|
||||
static inline db::Vector reduce_object (db::CellInstArrayWithProperties &ci)
|
||||
{
|
||||
return reduce_object_cell_inst_array (ci);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Compare operator for points/abstract repetition pair with configurable point compare operator
|
||||
*/
|
||||
template <class PC>
|
||||
struct rep_vector_cmp
|
||||
{
|
||||
bool operator () (const std::pair <db::Vector, std::pair <db::Coord, int> > &a, const std::pair <db::Vector, std::pair <db::Coord, int> > &b)
|
||||
{
|
||||
if (a.second != b.second) {
|
||||
return a.second < b.second;
|
||||
}
|
||||
PC pc;
|
||||
return pc (a.first, b.first);
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Represents a regular array
|
||||
*
|
||||
* A regular array is a set of displacements given by the
|
||||
* formula
|
||||
*
|
||||
* d = ia*a + ib*b
|
||||
*
|
||||
* where "ia" is an integer running from 0 to na-1, "ib" is an integer
|
||||
* running from 0 to nb-1 and "a" and "b" are two arbitrary vectors.
|
||||
*
|
||||
* The axes "a" and "b" do not need to be orthogonal in the general
|
||||
* case, but they should not be collinear.
|
||||
*
|
||||
* "na" and "nb" are the dimensions of the array.
|
||||
*
|
||||
* An array can be "null", which means it does not represent any
|
||||
* placements.
|
||||
*/
|
||||
class RegularArray
|
||||
{
|
||||
public:
|
||||
/**
|
||||
* @brief Creates a null array
|
||||
*/
|
||||
RegularArray ()
|
||||
: m_na (0), m_nb (0)
|
||||
{
|
||||
// .. nothing yet ..
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Creates an array with the given axes and dimensions
|
||||
*
|
||||
* @param a The "a" axis
|
||||
* @param b The "b" axis
|
||||
* @param na The "a" dimension
|
||||
* @param nb The "b" dimension
|
||||
*/
|
||||
RegularArray (const db::Vector &a, const db::Vector &b, size_t na, size_t nb)
|
||||
: m_a (a), m_b (b), m_na (na), m_nb (nb)
|
||||
{
|
||||
// .. nothing yet ..
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Returns a value indicating whether the array is a null array
|
||||
*/
|
||||
bool is_null () const
|
||||
{
|
||||
return m_na == 0 || m_nb == 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Gets the a axis
|
||||
*/
|
||||
const db::Vector &a () const { return m_a; }
|
||||
|
||||
/**
|
||||
* @brief Gets the b axis
|
||||
*/
|
||||
const db::Vector &b () const { return m_b; }
|
||||
|
||||
/**
|
||||
* @brief Gets the a dimension
|
||||
*/
|
||||
size_t na () const { return m_na; }
|
||||
|
||||
/**
|
||||
* @brief Gets the b dimension
|
||||
*/
|
||||
size_t nb () const { return m_nb; }
|
||||
|
||||
/**
|
||||
* @brief The equality operator
|
||||
*/
|
||||
bool operator== (const RegularArray &other) const
|
||||
{
|
||||
return m_a == other.m_a &&
|
||||
m_b == other.m_b &&
|
||||
m_na == other.m_na &&
|
||||
m_nb == other.m_nb;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief The less operator
|
||||
*
|
||||
* This operator is provided for strict weak ordering
|
||||
* for us of the array as a key in std::map or std::set.
|
||||
*/
|
||||
bool operator< (const RegularArray &other) const
|
||||
{
|
||||
if (m_a != other.m_a) {
|
||||
return m_a < other.m_a;
|
||||
}
|
||||
if (m_b != other.m_b) {
|
||||
return m_b < other.m_b;
|
||||
}
|
||||
if (m_na != other.m_na) {
|
||||
return m_na < other.m_na;
|
||||
}
|
||||
if (m_nb != other.m_nb) {
|
||||
return m_nb < other.m_nb;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private:
|
||||
db::Vector m_a, m_b;
|
||||
size_t m_na, m_nb;
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief An interface by which the compressor delivers the results of the compression
|
||||
*
|
||||
* Note that we're lacking virtual templates, hence the large number of
|
||||
* methods for every object type.
|
||||
*/
|
||||
class CompressorDelivery
|
||||
{
|
||||
public:
|
||||
typedef std::vector<db::Vector> disp_vector;
|
||||
|
||||
virtual ~CompressorDelivery () { }
|
||||
|
||||
virtual void write (const db::Point &obj, const RegularArray &array, const disp_vector &irregular) = 0;
|
||||
virtual void write (const db::PointWithProperties &obj, const RegularArray &array, const disp_vector &irregular) = 0;
|
||||
virtual void write (const db::Box &obj, const RegularArray &array, const disp_vector &irregular) = 0;
|
||||
virtual void write (const db::BoxWithProperties &obj, const RegularArray &array, const disp_vector &irregular) = 0;
|
||||
virtual void write (const db::Edge &obj, const RegularArray &array, const disp_vector &irregular) = 0;
|
||||
virtual void write (const db::EdgeWithProperties &obj, const RegularArray &array, const disp_vector &irregular) = 0;
|
||||
virtual void write (const db::EdgePair &obj, const RegularArray &array, const disp_vector &irregular) = 0;
|
||||
virtual void write (const db::EdgePairWithProperties &obj, const RegularArray &array, const disp_vector &irregular) = 0;
|
||||
virtual void write (const db::Polygon &obj, const RegularArray &array, const disp_vector &irregular) = 0;
|
||||
virtual void write (const db::PolygonWithProperties &obj, const RegularArray &array, const disp_vector &irregular) = 0;
|
||||
virtual void write (const db::SimplePolygon &obj, const RegularArray &array, const disp_vector &irregular) = 0;
|
||||
virtual void write (const db::SimplePolygonWithProperties &obj, const RegularArray &array, const disp_vector &irregular) = 0;
|
||||
virtual void write (const db::Path &obj, const RegularArray &array, const disp_vector &irregular) = 0;
|
||||
virtual void write (const db::PathWithProperties &obj, const RegularArray &array, const disp_vector &irregular) = 0;
|
||||
virtual void write (const db::Text &obj, const RegularArray &array, const disp_vector &irregular) = 0;
|
||||
virtual void write (const db::TextWithProperties &obj, const RegularArray &array, const disp_vector &irregular) = 0;
|
||||
virtual void write (const db::CellInstArray &obj, const RegularArray &array, const disp_vector &irregular) = 0;
|
||||
virtual void write (const db::CellInstArrayWithProperties &obj, const RegularArray &array, const disp_vector &irregular) = 0;
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief The compressor object
|
||||
*
|
||||
* The task of the compressor object is to accept a serial stream
|
||||
* of individual objects and arranging them into arrays as far as possible.
|
||||
*
|
||||
* Arrays can be regular (RegularArray) or enumerated (lists of placements).
|
||||
*
|
||||
* Individual objects are fed using the "add" method. Once all objects
|
||||
* are fed "flush" can be used to deliver the compressed arrays to a
|
||||
* "CompressorDelivery" object.
|
||||
*
|
||||
* Note that once "flush" is called, "add" should no longer be used.
|
||||
* For compressing new objects, construct a fresh Compressor object.
|
||||
*/
|
||||
template <class Obj>
|
||||
class Compressor
|
||||
{
|
||||
public:
|
||||
/**
|
||||
* @brief Constructor
|
||||
*
|
||||
* @param level The compression level
|
||||
*
|
||||
* Allowed levels are:
|
||||
* 0 - simple
|
||||
* 1 - form simple arrays
|
||||
* 2++ - search for 2nd, 3rd ... order neighbors
|
||||
*/
|
||||
Compressor (unsigned int level)
|
||||
: m_level (level)
|
||||
{
|
||||
// .. nothing yet ..
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Adds a new object with the given displacement
|
||||
*
|
||||
* The object is supposed to be reduced (positioned at 0,0)
|
||||
* already and the displacement specifies where the object
|
||||
* was sitting originally.
|
||||
*/
|
||||
void add (const Obj &obj, const db::Vector &disp)
|
||||
{
|
||||
if (! object_is_empty (obj)) {
|
||||
m_normalized [obj].push_back (disp);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Adds an object with reduction
|
||||
*
|
||||
* The object added can sit anywhere. Before it is added,
|
||||
* it is reduced (positioned at 0,0) and the displacement
|
||||
* is recorded for array formation.
|
||||
*/
|
||||
void add (const Obj &obj)
|
||||
{
|
||||
if (! object_is_empty (obj)) {
|
||||
Obj red (obj);
|
||||
auto disp = reduce_object (red);
|
||||
m_normalized [red].push_back (disp);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Generates arrays and delivers when to the delivery interface
|
||||
*
|
||||
* This method will can "deliver->write (Object, ...)" as many times as
|
||||
* needed.
|
||||
*
|
||||
* Note that single objects may be delivered as well. These are encoded
|
||||
* as null regular arrays and empty irregular placement lists.
|
||||
*/
|
||||
void flush (CompressorDelivery *delivery);
|
||||
|
||||
private:
|
||||
typedef std::vector<db::Vector> disp_vector;
|
||||
|
||||
std::unordered_map <Obj, disp_vector> m_normalized;
|
||||
unsigned int m_level;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
|
@ -0,0 +1,39 @@
|
|||
|
||||
/*
|
||||
|
||||
KLayout Layout Viewer
|
||||
Copyright (C) 2006-2025 Matthias Koefferlein
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
*/
|
||||
|
||||
#include "lstrFormat.h"
|
||||
|
||||
namespace lstr
|
||||
{
|
||||
|
||||
WriterOptions::WriterOptions ()
|
||||
: compression_level (2), recompress (false), permissive (false)
|
||||
{
|
||||
// .. nothing yet ..
|
||||
}
|
||||
|
||||
ReaderOptions::ReaderOptions ()
|
||||
{
|
||||
// .. nothing yet ..
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,131 @@
|
|||
|
||||
/*
|
||||
|
||||
KLayout Layout Viewer
|
||||
Copyright (C) 2006-2025 Matthias Koefferlein
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
*/
|
||||
|
||||
#ifndef HDR_lstrFormat
|
||||
#define HDR_lstrFormat
|
||||
|
||||
#include "dbPluginCommon.h"
|
||||
#include "dbLoadLayoutOptions.h"
|
||||
#include "dbSaveLayoutOptions.h"
|
||||
|
||||
namespace lstr
|
||||
{
|
||||
|
||||
/**
|
||||
* @brief Structure that holds the LStream specific options for the reader
|
||||
* NOTE: this structure is non-public linkage by intention. This way it's instantiated
|
||||
* in all compile units and the shared object does not need to be linked.
|
||||
*/
|
||||
class DB_PLUGIN_PUBLIC ReaderOptions
|
||||
: public db::FormatSpecificReaderOptions
|
||||
{
|
||||
public:
|
||||
/**
|
||||
* @brief The constructor
|
||||
*/
|
||||
ReaderOptions ();
|
||||
|
||||
/**
|
||||
* @brief If not empty, this string specifies a key under which the bbox from the stream is stored in the cells
|
||||
*/
|
||||
std::string bbox_meta_info_key;
|
||||
|
||||
/**
|
||||
* @brief Implementation of FormatSpecificReaderOptions
|
||||
*/
|
||||
virtual db::FormatSpecificReaderOptions *clone () const
|
||||
{
|
||||
return new ReaderOptions (*this);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Implementation of FormatSpecificReaderOptions
|
||||
*/
|
||||
virtual const std::string &format_name () const
|
||||
{
|
||||
static const std::string n ("LStream");
|
||||
return n;
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Structure that holds the OASIS specific options for the Writer
|
||||
* NOTE: this structure is non-public linkage by intention. This way it's instantiated
|
||||
* in all compile units and the shared object does not need to be linked.
|
||||
*/
|
||||
class DB_PLUGIN_PUBLIC WriterOptions
|
||||
: public db::FormatSpecificWriterOptions
|
||||
{
|
||||
public:
|
||||
/**
|
||||
* @brief The constructor
|
||||
*/
|
||||
WriterOptions ();
|
||||
|
||||
/**
|
||||
* @brief OASIS writer compression level
|
||||
*
|
||||
* This level describes how hard the OASIS writer will try to compress the shapes
|
||||
* using shape arrays. Building shape arrays may take some time and requires some memory.
|
||||
* 0 - no shape array building
|
||||
* 1 - nearest neighbor shape array formation
|
||||
* 2++ - enhanced shape array search algorithm using 2nd and further neighbor distances as well
|
||||
*/
|
||||
int compression_level;
|
||||
|
||||
/**
|
||||
* @brief Recompressions
|
||||
*
|
||||
* If the recompression flag is true, existing shape arrays will be resolved and
|
||||
* put into the compressor again (may take longer).
|
||||
*/
|
||||
bool recompress;
|
||||
|
||||
/**
|
||||
* @brief Permissive mode
|
||||
*
|
||||
* In permissive mode, a warning is issued for certain cases rather than
|
||||
* an error. For example paths/circles with odd diameter (rounded).
|
||||
*/
|
||||
bool permissive;
|
||||
|
||||
/**
|
||||
* @brief Implementation of FormatSpecificWriterOptions
|
||||
*/
|
||||
virtual db::FormatSpecificWriterOptions *clone () const
|
||||
{
|
||||
return new WriterOptions (*this);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Implementation of FormatSpecificWriterOptions
|
||||
*/
|
||||
virtual const std::string &format_name () const
|
||||
{
|
||||
static std::string n ("LStream");
|
||||
return n;
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
@ -0,0 +1,121 @@
|
|||
|
||||
/*
|
||||
|
||||
KLayout Layout Viewer
|
||||
Copyright (C) 2006-2025 Matthias Koefferlein
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
*/
|
||||
|
||||
#include "lstrReader.h"
|
||||
#include "lstrWriter.h"
|
||||
#include "lstrPlugin.h"
|
||||
#include "lstrFormat.h"
|
||||
|
||||
#include "dbStream.h"
|
||||
#include "version.h"
|
||||
|
||||
#include "tlClassRegistry.h"
|
||||
|
||||
namespace lstr
|
||||
{
|
||||
|
||||
// ---------------------------------------------------------------
|
||||
// Signature string and generator
|
||||
|
||||
const char *LStream_sig = "LStream_1.0";
|
||||
|
||||
const char *LStream_generator = "klayout " STRINGIFY(KLAYOUT_VERSION);
|
||||
|
||||
// ---------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* @brief The LStream plugin
|
||||
*
|
||||
* Providing a class a regiserting it will enable this file
|
||||
* format inside KLayout.
|
||||
*
|
||||
* It implements the "db::StreamFormatDeclaration" interface
|
||||
* and provides KLayout with the necessary information to
|
||||
* implement the format.
|
||||
*/
|
||||
class LStreamFormatDeclaration
|
||||
: public db::StreamFormatDeclaration
|
||||
{
|
||||
virtual std::string format_name () const { return "LStream"; }
|
||||
virtual std::string format_desc () const { return "LStream"; }
|
||||
virtual std::string format_title () const { return "LStream"; }
|
||||
virtual std::string file_format () const { return "LStream files (*.lstr *.lstr.gz)"; }
|
||||
|
||||
/**
|
||||
* @brief Returns a value indicating whether the given stream represents the particular format
|
||||
*
|
||||
* KLayout will use this method to identify a file by content, rather than
|
||||
* suffix. In the LStream case, the format is detected by the magic bytes
|
||||
* at the front of the stream.
|
||||
*/
|
||||
virtual bool detect (tl::InputStream &stream) const
|
||||
{
|
||||
const char *hdr = stream.get (strlen (LStream_sig) + 1);
|
||||
return (hdr && strcmp (hdr, LStream_sig) == 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Creates a reader object that does the actual reading
|
||||
*/
|
||||
virtual db::ReaderBase *create_reader (tl::InputStream &s) const
|
||||
{
|
||||
return new Reader (s);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Creates a writer object that does the actual reading
|
||||
*/
|
||||
virtual db::WriterBase *create_writer () const
|
||||
{
|
||||
return new Writer ();
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Returns a value indicating whether reading is supported
|
||||
*/
|
||||
virtual bool can_read () const
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Returns a value indicating whether writing is supported
|
||||
*/
|
||||
virtual bool can_write () const
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
virtual tl::XMLElementBase *xml_writer_options_element () const
|
||||
{
|
||||
return new db::WriterOptionsXMLElement<lstr::WriterOptions> ("lstream",
|
||||
tl::make_member (&lstr::WriterOptions::compression_level, "compression-level") +
|
||||
tl::make_member (&lstr::WriterOptions::recompress, "recompress") +
|
||||
tl::make_member (&lstr::WriterOptions::permissive, "permissive")
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
static tl::RegisteredClass<db::StreamFormatDeclaration> format_decl (new LStreamFormatDeclaration (), 2050, "LStream");
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,41 @@
|
|||
|
||||
/*
|
||||
|
||||
KLayout Layout Viewer
|
||||
Copyright (C) 2006-2025 Matthias Koefferlein
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
*/
|
||||
|
||||
#ifndef HDR_lstrPlugin
|
||||
#define HDR_lstrPlugin
|
||||
|
||||
namespace lstr
|
||||
{
|
||||
|
||||
/**
|
||||
* @brief The magic bytes at the beginning of a LStream file
|
||||
*/
|
||||
extern const char *LStream_sig;
|
||||
|
||||
/**
|
||||
* @brief The generator name for writing Header::generator
|
||||
*/
|
||||
extern const char *LStream_generator;
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
File diff suppressed because it is too large
Load Diff
|
|
@ -0,0 +1,268 @@
|
|||
|
||||
/*
|
||||
|
||||
KLayout Layout Viewer
|
||||
Copyright (C) 2006-2025 Matthias Koefferlein
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
*/
|
||||
|
||||
#ifndef HDR_lstrReader
|
||||
#define HDR_lstrReader
|
||||
|
||||
#include "dbPluginCommon.h"
|
||||
#include "dbLayout.h"
|
||||
#include "dbCommonReader.h"
|
||||
#include "dbStreamLayers.h"
|
||||
|
||||
#include "library.capnp.h"
|
||||
#include "repetition.capnp.h"
|
||||
#include "layoutView.capnp.h"
|
||||
|
||||
#include "tlException.h"
|
||||
#include "tlProgress.h"
|
||||
#include "tlInternational.h"
|
||||
#include "tlProgress.h"
|
||||
#include "tlString.h"
|
||||
#include "tlStream.h"
|
||||
|
||||
#include <kj/io.h>
|
||||
|
||||
namespace kj
|
||||
{
|
||||
class BufferedInputStream;
|
||||
}
|
||||
|
||||
namespace lstr
|
||||
{
|
||||
|
||||
/**
|
||||
* @brief A reimplementation of the kj::InputStream interface to provide KLayout streams for Cap'n'Proto
|
||||
*
|
||||
* Note: this implementation is not based on the buffered streams of KLayout
|
||||
* which are not compatible with kj::BufferedInputStreamWrapper as of now.
|
||||
* Instead we use the unterlying basic stream of KLayout which is pretty
|
||||
* much compatible with kj.
|
||||
*/
|
||||
class InputStream
|
||||
: public kj::InputStream
|
||||
{
|
||||
public:
|
||||
InputStream (tl::InputStream *is)
|
||||
: mp_is (is), m_pos (is->pos ()), m_pos_before (is->pos ())
|
||||
{
|
||||
// .. nothing yet ..
|
||||
}
|
||||
|
||||
virtual size_t tryRead (void *buffer, size_t /*min_bytes*/, size_t max_bytes)
|
||||
{
|
||||
size_t n = mp_is->base ()->read ((char *) buffer, max_bytes);
|
||||
m_pos_before = m_pos;
|
||||
m_pos += n;
|
||||
return n;
|
||||
}
|
||||
|
||||
/* TODO: we don't have "skip" on the delegate right now.
|
||||
virtual void skip (size_t bytes)
|
||||
{
|
||||
mp_is->base ()->skip (bytes);
|
||||
}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @brief Resets the basic stream, so we can restart
|
||||
*/
|
||||
void reset ()
|
||||
{
|
||||
mp_is->base ()->reset ();
|
||||
m_pos_before = m_pos = 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Gets the position in the stream after the current chunk
|
||||
*/
|
||||
size_t position ()
|
||||
{
|
||||
return m_pos;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Gets the position in the stream before the current chunk
|
||||
*/
|
||||
size_t position_before ()
|
||||
{
|
||||
return m_pos_before;
|
||||
}
|
||||
|
||||
private:
|
||||
tl::InputStream *mp_is;
|
||||
size_t m_pos, m_pos_before;
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Generic base class of LStream reader exceptions
|
||||
*/
|
||||
class DB_PLUGIN_PUBLIC LStreamReaderException
|
||||
: public db::ReaderException
|
||||
{
|
||||
public:
|
||||
LStreamReaderException (const std::string &msg, const std::string &cell, const std::string &source, const std::string &pos)
|
||||
: db::ReaderException (
|
||||
cell.empty () ?
|
||||
tl::sprintf (tl::to_string (tr ("%s, in file: %s (position %s)")), msg, source, pos) :
|
||||
tl::sprintf (tl::to_string (tr ("%s (cell=%s), in file: %s (position %s)")), msg, cell, source, pos)
|
||||
)
|
||||
{ }
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief The LStream format stream reader
|
||||
*/
|
||||
class DB_PLUGIN_PUBLIC Reader
|
||||
: public db::CommonReader
|
||||
{
|
||||
public:
|
||||
/**
|
||||
* @brief Construct a stream reader object
|
||||
*
|
||||
* @param s The stream delegate from which to read stream data from
|
||||
*/
|
||||
Reader (tl::InputStream &s);
|
||||
|
||||
/**
|
||||
* @brief Destructor
|
||||
*/
|
||||
~Reader () noexcept;
|
||||
|
||||
/**
|
||||
* @brief Format
|
||||
*/
|
||||
virtual const char *format () const { return "LStream"; }
|
||||
|
||||
protected:
|
||||
/**
|
||||
* @brief Implementation of the db::CommonReader interface
|
||||
*
|
||||
* This method will read the information from the stream
|
||||
* passed in the constructor.
|
||||
*/
|
||||
virtual void do_read (db::Layout &layout);
|
||||
|
||||
/**
|
||||
* @brief Implementation of db::CommonReader InputStream
|
||||
*
|
||||
* This method is called to initialize the reader
|
||||
* from the given options.
|
||||
*/
|
||||
virtual void init (const db::LoadLayoutOptions &options);
|
||||
|
||||
/**
|
||||
* @brief Issues an errors
|
||||
*/
|
||||
void error (const std::string &msg);
|
||||
|
||||
/**
|
||||
* @brief Issues a warning
|
||||
*
|
||||
* The warning level indicates the severity.
|
||||
* A higher value indicates lower severity.
|
||||
*/
|
||||
void warn (const std::string &msg, int warn_level = 1);
|
||||
|
||||
/**
|
||||
* @brief Accessor method to the current cellname
|
||||
*/
|
||||
const std::string &cellname () const { return m_cellname; }
|
||||
|
||||
private:
|
||||
lstr::InputStream m_stream;
|
||||
std::string m_source;
|
||||
std::string m_bbox_meta_data_key;
|
||||
tl::AbsoluteProgress m_progress;
|
||||
size_t m_library_index;
|
||||
std::string m_cellname;
|
||||
std::string m_libname;
|
||||
db::Cell *mp_cell;
|
||||
db::Layout *mp_layout;
|
||||
std::map<uint64_t, unsigned int> m_layer_id_map;
|
||||
std::map<uint64_t, std::string> m_library_names_by_id;
|
||||
std::map<uint64_t, db::property_names_id_type> m_property_name_id_map;
|
||||
std::map<uint64_t, db::properties_id_type> m_properties_id_map;
|
||||
std::map<uint64_t, const db::StringRef *> m_text_strings_by_id;
|
||||
uint64_t m_layout_view_id;
|
||||
uint64_t m_meta_data_view_id;
|
||||
std::vector<std::pair<db::cell_index_type, std::string> > m_cells;
|
||||
|
||||
void yield_progress ();
|
||||
std::string position ();
|
||||
void do_read_internal (db::Layout &layout);
|
||||
void read_header (kj::BufferedInputStream &is);
|
||||
void read_library (kj::BufferedInputStream &is);
|
||||
void skip_library (kj::BufferedInputStream &is);
|
||||
void read_cell (db::cell_index_type cell_index, kj::BufferedInputStream &is);
|
||||
void make_single_cell_instance (db::cell_index_type of_cell, db::properties_id_type prop_id, const db::ICplxTrans &ct);
|
||||
void make_cell_instance (db::cell_index_type of_cell, db::properties_id_type prop_id, stream::repetition::Repetition::Reader repetition, const db::ICplxTrans &ct);
|
||||
void read_instances (stream::layoutView::LayoutView::Reader layout_view);
|
||||
template <class Object, class CPObject>
|
||||
void read_shapes (unsigned int li, typename stream::layoutView::ObjectContainerForType<CPObject>::Reader reader, capnp::List<stream::repetition::Repetition, capnp::Kind::STRUCT>::Reader repetitions);
|
||||
void read_layer (stream::layoutView::Layer::Reader reader);
|
||||
void read_layout_view (db::cell_index_type cell_index, kj::BufferedInputStream &is);
|
||||
void read_meta_data_view (db::cell_index_type cell_index, kj::BufferedInputStream &is);
|
||||
void read_layers (stream::library::ViewSpec::Reader view_specs);
|
||||
tl::Variant make_variant (stream::variant::Variant::Value::Reader variant);
|
||||
void make_meta_data(const db::Cell *cell, stream::metaData::MetaData::Reader property_set);
|
||||
std::map<std::string, tl::Variant> make_pcell_parameters (stream::library::CellParameters::Reader cell_parameters);
|
||||
void read_cells(stream::library::Library::Reader header);
|
||||
void read_library_refs (stream::library::Library::Reader header);
|
||||
void read_properties (stream::library::Library::Reader header);
|
||||
void read_text_strings (stream::library::Library::Reader header);
|
||||
unsigned int get_layer_by_id (uint64_t id) const;
|
||||
std::string get_library_name_by_id (uint64_t id) const;
|
||||
db::property_names_id_type get_property_name_id_by_id (uint64_t id) const;
|
||||
db::properties_id_type get_properties_id_by_id (uint64_t id) const;
|
||||
const db::StringRef *get_string_by_id (uint64_t id) const;
|
||||
db::Vector make_object (stream::geometry::Vector::Reader reader);
|
||||
db::Point make_object (stream::geometry::Point::Reader reader);
|
||||
db::Box make_object (stream::geometry::Box::Reader reader);
|
||||
db::Edge make_object (stream::geometry::Edge::Reader reader);
|
||||
db::EdgePair make_object (stream::geometry::EdgePair::Reader reader);
|
||||
db::SimplePolygonRef make_object (stream::geometry::SimplePolygon::Reader reader);
|
||||
db::PolygonRef make_object (stream::geometry::Polygon::Reader reader);
|
||||
db::PathRef make_object (stream::geometry::Path::Reader reader);
|
||||
db::Text make_object (stream::geometry::Label::Reader reader);
|
||||
void make_object_array (unsigned int li, db::properties_id_type prop_id, const db::PolygonRef &object, stream::repetition::Repetition::Reader repetition);
|
||||
void make_object_array (unsigned int li, db::properties_id_type prop_id, const db::SimplePolygonRef &object, stream::repetition::Repetition::Reader repetition);
|
||||
void make_object_array (unsigned int li, db::properties_id_type prop_id, const db::PathRef &object, stream::repetition::Repetition::Reader repetition);
|
||||
void make_object_array (unsigned int li, db::properties_id_type prop_id, const db::EdgePair &object, stream::repetition::Repetition::Reader repetition);
|
||||
void make_object_array (unsigned int li, db::properties_id_type prop_id, const db::Edge &object, stream::repetition::Repetition::Reader repetition);
|
||||
void make_object_array (unsigned int li, db::properties_id_type prop_id, const db::Point &object, stream::repetition::Repetition::Reader repetition);
|
||||
void make_object_array (unsigned int li, db::properties_id_type prop_id, const db::Text &object, stream::repetition::Repetition::Reader repetition);
|
||||
void make_object_array (unsigned int li, db::properties_id_type prop_id, const db::Box &object, stream::repetition::Repetition::Reader repetition);
|
||||
template <class Object>
|
||||
void make_object_array_ref (unsigned int li, db::properties_id_type prop_id, const Object &object, stream::repetition::Repetition::Reader repetition);
|
||||
template <class Object, class ObjectPtr>
|
||||
void make_object_array_ptr (unsigned int li, db::properties_id_type prop_id, const Object &object, stream::repetition::Repetition::Reader repetition);
|
||||
template <class Object>
|
||||
void make_object_array_explode (unsigned int li, db::properties_id_type prop_id, const Object &object, stream::repetition::Repetition::Reader repetition);
|
||||
|
||||
virtual void common_reader_error (const std::string &msg) { error (msg); }
|
||||
virtual void common_reader_warn (const std::string &msg, int warn_level = 1) { warn (msg, warn_level); }
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
|
|
@ -0,0 +1,142 @@
|
|||
|
||||
/*
|
||||
|
||||
KLayout Layout Viewer
|
||||
Copyright (C) 2006-2025 Matthias Koefferlein
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
*/
|
||||
|
||||
#ifndef HDR_lstrWriter
|
||||
#define HDR_lstrWriter
|
||||
|
||||
#include "lstrCompressed.h"
|
||||
|
||||
#include "dbPluginCommon.h"
|
||||
#include "dbWriterTools.h"
|
||||
#include "dbWriter.h"
|
||||
|
||||
#include "tlProgress.h"
|
||||
|
||||
#include "header.capnp.h"
|
||||
#include "library.capnp.h"
|
||||
#include "variant.capnp.h"
|
||||
#include "geometry.capnp.h"
|
||||
#include "cell.capnp.h"
|
||||
#include "layoutView.capnp.h"
|
||||
|
||||
#include <capnp/serialize-packed.h>
|
||||
|
||||
namespace kj
|
||||
{
|
||||
class BufferedOutputStream;
|
||||
}
|
||||
|
||||
namespace lstr
|
||||
{
|
||||
|
||||
/**
|
||||
* @brief The LStream format stream writer
|
||||
*/
|
||||
class DB_PLUGIN_PUBLIC Writer
|
||||
: public db::WriterBase
|
||||
{
|
||||
public:
|
||||
/**
|
||||
* @brief Instantiate the writer
|
||||
*/
|
||||
Writer ();
|
||||
|
||||
/**
|
||||
* @brief Writes the layout object
|
||||
*
|
||||
* @param layout The layout object to write
|
||||
* @param stream The stream to write to
|
||||
* @param options The writer options to use
|
||||
*/
|
||||
void write (db::Layout &layout, tl::OutputStream &stream, const db::SaveLayoutOptions &options);
|
||||
|
||||
private:
|
||||
tl::OutputStream *mp_stream;
|
||||
tl::AbsoluteProgress m_progress;
|
||||
db::SaveLayoutOptions m_options;
|
||||
bool m_recompress;
|
||||
int m_compression_level;
|
||||
bool m_permissive;
|
||||
db::Layout *mp_layout;
|
||||
std::string m_cellname;
|
||||
int m_layout_view_id;
|
||||
int m_meta_data_view_id;
|
||||
std::map<db::lib_id_type, uint64_t> m_ls_lib_ids;
|
||||
std::vector<std::pair <unsigned int, db::LayerProperties> > m_layers_to_write;
|
||||
std::set<db::cell_index_type> m_cells_to_write;
|
||||
std::map<db::property_names_id_type, uint64_t> m_ls_prop_name_ids;
|
||||
std::map<db::properties_id_type, uint64_t> m_ls_prop_ids;
|
||||
std::map<std::string, uint64_t> m_text_strings;
|
||||
std::map<db::cell_index_type, uint64_t> m_ls_cell_ids;
|
||||
|
||||
void yield_progress ();
|
||||
void warn (const std::string &msg);
|
||||
void write_header (kj::BufferedOutputStream &os);
|
||||
void write_library (kj::BufferedOutputStream &os);
|
||||
void make_library_refs_table (stream::library::LibraryRefs::Builder library_names);
|
||||
uint64_t get_library_ref_id (db::lib_id_type lib_id);
|
||||
void collect_property_ids (std::vector<db::properties_id_type> &prop_ids, std::vector<db::property_names_id_type> &prop_names);
|
||||
uint64_t make_property_id (db::properties_id_type id, std::vector<db::properties_id_type> &prop_ids, std::vector<db::property_names_id_type> &prop_names);
|
||||
uint64_t make_property_name_id_from_id (db::property_names_id_type name_id, std::vector<db::property_names_id_type> &prop_names);
|
||||
uint64_t make_property_name_id_from_variant (const tl::Variant &name, std::vector<db::property_names_id_type> &prop_names);
|
||||
uint64_t get_property_id (db::properties_id_type id);
|
||||
uint64_t get_property_name_id_from_id (db::property_names_id_type name_id);
|
||||
uint64_t get_property_name_id_from_variant (const tl::Variant &name);
|
||||
void make_property_names_tables (const std::vector<db::property_names_id_type> &prop_names, stream::library::PropertyNamesTable::Builder property_names);
|
||||
void make_properties_tables (const std::vector<db::properties_id_type> &prop_ids, stream::library::PropertiesTable::Builder properties);
|
||||
void make_variant_value (const tl::Variant &value, stream::variant::Variant::Builder builder);
|
||||
void collect_text_strings (std::vector<std::string> &text_strings);
|
||||
uint64_t make_text_string_id (const std::string &string, std::vector<std::string> &text_strings);
|
||||
uint64_t get_text_string_id (const std::string &string);
|
||||
void make_text_strings_table (const std::vector<std::string> &text_strings, stream::library::TextStringsTable::Builder table);
|
||||
void make_layer_table (stream::library::LayerTable::Builder layers);
|
||||
void make_cell_specs (stream::library::CellSpecsTable::Builder cell_specs);
|
||||
uint64_t get_cell_id (db::cell_index_type ci);
|
||||
void make_cell_hierarchy_tree (stream::library::CellHierarchyTree::Builder cell_tree);
|
||||
void make_meta_data (const db::Cell *cell, stream::metaData::MetaData::Builder meta_data);
|
||||
|
||||
void write_cell (db::cell_index_type ci, kj::BufferedOutputStream &os);
|
||||
void write_layout_view (db::cell_index_type ci, kj::BufferedOutputStream &os);
|
||||
void write_meta_data_view (db::cell_index_type ci, kj::BufferedOutputStream &os);
|
||||
void make_repetition (const RegularArray &array, stream::repetition::Repetition::Builder builder);
|
||||
void make_repetition (const std::vector<db::Vector> &disp_array, stream::repetition::Repetition::Builder builder);
|
||||
void make_object (const db::SimplePolygon &obj, stream::geometry::SimplePolygon::Builder cpnp_obj);
|
||||
void make_object (const db::Polygon &obj, stream::geometry::Polygon::Builder cpnp_obj);
|
||||
void make_object (const db::Edge &obj, stream::geometry::Edge::Builder cpnp_obj);
|
||||
void make_object (const db::EdgePair &obj, stream::geometry::EdgePair::Builder cpnp_obj);
|
||||
void make_object (const db::Point &obj, stream::geometry::Point::Builder cpnp_obj);
|
||||
void make_object (const db::Box &obj, stream::geometry::Box::Builder cpnp_obj);
|
||||
void make_object (const db::Text &obj, stream::geometry::Label::Builder cpnp_obj);
|
||||
void make_object (const db::Path &obj, stream::geometry::Path::Builder cpnp_obj);
|
||||
void make_object (const db::CellInstArray &obj, stream::layoutView::CellInstance::Builder cpnp_obj);
|
||||
template <class Object, class Builder>
|
||||
void make_objects (const Compressed::compressed_container<Object> &container, Builder builder);
|
||||
stream::geometry::FixPointTransformation make_fixpoint_transformation (const db::Trans &trans);
|
||||
|
||||
// for debugging
|
||||
void replicate_message (const std::string &suffix, capnp::MessageBuilder &builder);
|
||||
};
|
||||
|
||||
} // namespace db
|
||||
|
||||
#endif
|
||||
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
|
||||
[library]
|
||||
name = "_lstream_dbpi"
|
||||
defines = [["MAKE_DB_PLUGIN_LIBRARY", 1], ["CAPNP_LITE", 1]]
|
||||
depends = ["_tl", "_db", "_gsi"]
|
||||
includes = ["/src/plugins/common", "/src/version", "capnp", "../runtime/capnp", "../runtime/kj"]
|
||||
submodules = ["db_plugins"]
|
||||
sources = ["capnp", "../runtime/capnp/capnp", "../runtime/kj/kj"]
|
||||
cxxflags-gcc = ["-std=c++14"]
|
||||
|
||||
|
|
@ -0,0 +1,283 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>LStreamWriterOptionPage</class>
|
||||
<widget class="QWidget" name="LStreamWriterOptionPage">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>633</width>
|
||||
<height>338</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Form</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout">
|
||||
<property name="spacing">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<property name="leftMargin">
|
||||
<number>9</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>9</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>9</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>9</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="groupBox">
|
||||
<property name="title">
|
||||
<string>LStream Writer Options</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout">
|
||||
<property name="spacing">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<property name="leftMargin">
|
||||
<number>9</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>9</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>9</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>9</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QFrame" name="frame">
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::NoFrame</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Raised</enum>
|
||||
</property>
|
||||
<layout class="QGridLayout">
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="spacing">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<item row="1" column="3">
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<spacer>
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>QSizePolicy::Fixed</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>10</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="2" column="2" colspan="3">
|
||||
<widget class="QFrame" name="cblock_warning_frame">
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::NoFrame</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Raised</enum>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="2" colspan="3">
|
||||
<widget class="QFrame" name="frame_2">
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::NoFrame</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Raised</enum>
|
||||
</property>
|
||||
<layout class="QHBoxLayout">
|
||||
<property name="spacing">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="2" colspan="3">
|
||||
<widget class="QFrame" name="strict_mode_warning_frame">
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::NoFrame</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Raised</enum>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0" rowspan="2">
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Compaction level
|
||||
(repetition detection)</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="2">
|
||||
<widget class="QLabel" name="label_3">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>0 (low)</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="0">
|
||||
<widget class="QLabel" name="label_10">
|
||||
<property name="text">
|
||||
<string>Permissive mode</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="2" colspan="3">
|
||||
<widget class="QSlider" name="compression_slider">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>10</number>
|
||||
</property>
|
||||
<property name="pageStep">
|
||||
<number>1</number>
|
||||
</property>
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="tickPosition">
|
||||
<enum>QSlider::TicksBelow</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="2" colspan="3">
|
||||
<widget class="QCheckBox" name="permissive">
|
||||
<property name="text">
|
||||
<string>Don't fail on paths with odd width and other odd shapes</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="4">
|
||||
<widget class="QLabel" name="label_4">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>(high) 10</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer>
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>524</width>
|
||||
<height>51</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<tabstops>
|
||||
<tabstop>compression_slider</tabstop>
|
||||
</tabstops>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
|
|
@ -0,0 +1,59 @@
|
|||
|
||||
/*
|
||||
|
||||
KLayout Layout Viewer
|
||||
Copyright (C) 2006-2025 Matthias Koefferlein
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
*/
|
||||
|
||||
#include "lstrReader.h"
|
||||
#include "lstrFormat.h"
|
||||
#include "dbLoadLayoutOptions.h"
|
||||
#include "layLStreamReaderPlugin.h"
|
||||
#include "gsiDecl.h"
|
||||
|
||||
namespace lay
|
||||
{
|
||||
|
||||
// ---------------------------------------------------------------
|
||||
// LStreamReaderPluginDeclaration definition and implementation
|
||||
|
||||
class LStreamReaderPluginDeclaration
|
||||
: public StreamReaderPluginDeclaration
|
||||
{
|
||||
public:
|
||||
LStreamReaderPluginDeclaration ()
|
||||
: StreamReaderPluginDeclaration (lstr::ReaderOptions ().format_name ())
|
||||
{
|
||||
// .. nothing yet ..
|
||||
}
|
||||
|
||||
StreamReaderOptionsPage *format_specific_options_page (QWidget *parent) const
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
db::FormatSpecificReaderOptions *create_specific_options () const
|
||||
{
|
||||
return new lstr::ReaderOptions ();
|
||||
}
|
||||
};
|
||||
|
||||
static tl::RegisteredClass<lay::PluginDeclaration> plugin_decl (new lay::LStreamReaderPluginDeclaration (), 10000, "LStreamReader");
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,38 @@
|
|||
|
||||
/*
|
||||
|
||||
KLayout Layout Viewer
|
||||
Copyright (C) 2006-2025 Matthias Koefferlein
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
*/
|
||||
|
||||
|
||||
#ifndef HDR_layLStreamReaderPlugin_h
|
||||
#define HDR_layLStreamReaderPlugin_h
|
||||
|
||||
#include "layStream.h"
|
||||
|
||||
namespace lay
|
||||
{
|
||||
|
||||
// .. nothing yet ..
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,99 @@
|
|||
|
||||
/*
|
||||
|
||||
KLayout Layout Viewer
|
||||
Copyright (C) 2006-2025 Matthias Koefferlein
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
*/
|
||||
|
||||
|
||||
#include "dbSaveLayoutOptions.h"
|
||||
#include "lstrWriter.h"
|
||||
#include "lstrFormat.h"
|
||||
#include "layLStreamWriterPlugin.h"
|
||||
|
||||
#include <QFrame>
|
||||
|
||||
namespace lay
|
||||
{
|
||||
|
||||
// ---------------------------------------------------------------
|
||||
// LStreamWriterOptionPage definition and implementation
|
||||
|
||||
LStreamWriterOptionPage::LStreamWriterOptionPage (QWidget *parent)
|
||||
: StreamWriterOptionsPage (parent)
|
||||
{
|
||||
mp_ui = new Ui::LStreamWriterOptionPage ();
|
||||
mp_ui->setupUi (this);
|
||||
}
|
||||
|
||||
LStreamWriterOptionPage::~LStreamWriterOptionPage ()
|
||||
{
|
||||
delete mp_ui;
|
||||
}
|
||||
|
||||
void
|
||||
LStreamWriterOptionPage::setup (const db::FormatSpecificWriterOptions *o, const db::Technology * /*tech*/)
|
||||
{
|
||||
const lstr::WriterOptions *options = dynamic_cast<const lstr::WriterOptions *> (o);
|
||||
if (options) {
|
||||
mp_ui->compression_slider->setValue (options->compression_level);
|
||||
mp_ui->permissive->setChecked (options->permissive);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
LStreamWriterOptionPage::commit (db::FormatSpecificWriterOptions *o, const db::Technology * /*tech*/, bool gzip)
|
||||
{
|
||||
lstr::WriterOptions *options = dynamic_cast<lstr::WriterOptions *> (o);
|
||||
if (options) {
|
||||
options->compression_level = mp_ui->compression_slider->value ();
|
||||
options->permissive = mp_ui->permissive->isChecked ();
|
||||
}
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------
|
||||
// LStreamWriterPluginDeclaration definition and implementation
|
||||
|
||||
class LStreamWriterPluginDeclaration
|
||||
: public StreamWriterPluginDeclaration
|
||||
{
|
||||
public:
|
||||
LStreamWriterPluginDeclaration ()
|
||||
: StreamWriterPluginDeclaration (lstr::WriterOptions ().format_name ())
|
||||
{
|
||||
// .. nothing yet ..
|
||||
}
|
||||
|
||||
StreamWriterOptionsPage *format_specific_options_page (QWidget *parent) const
|
||||
{
|
||||
return new LStreamWriterOptionPage (parent);
|
||||
}
|
||||
|
||||
db::FormatSpecificWriterOptions *create_specific_options () const
|
||||
{
|
||||
return new lstr::WriterOptions ();
|
||||
}
|
||||
};
|
||||
|
||||
static tl::RegisteredClass<lay::PluginDeclaration> plugin_decl (new lay::LStreamWriterPluginDeclaration (), 10002, "LStreamWriter");
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,52 @@
|
|||
|
||||
/*
|
||||
|
||||
KLayout Layout Viewer
|
||||
Copyright (C) 2006-2025 Matthias Koefferlein
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
*/
|
||||
|
||||
|
||||
#ifndef HDR_layLStreamWriterPlugin_h
|
||||
#define HDR_layLStreamWriterPlugin_h
|
||||
|
||||
#include "layStream.h"
|
||||
#include "ui_LStreamWriterOptionPage.h"
|
||||
|
||||
namespace lay
|
||||
{
|
||||
|
||||
class LStreamWriterOptionPage
|
||||
: public StreamWriterOptionsPage
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
LStreamWriterOptionPage (QWidget *parent);
|
||||
~LStreamWriterOptionPage ();
|
||||
|
||||
void setup (const db::FormatSpecificWriterOptions *options, const db::Technology *tech);
|
||||
void commit (db::FormatSpecificWriterOptions *options, const db::Technology *tech, bool gzip);
|
||||
|
||||
private:
|
||||
Ui::LStreamWriterOptionPage *mp_ui;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
|
||||
DESTDIR = $$OUT_PWD/../../../../lay_plugins
|
||||
|
||||
include($$PWD/../../../lay_plugin.pri)
|
||||
include($$PWD/../lstream.pri)
|
||||
|
||||
INCLUDEPATH += $$PWD/../db_plugin $$PWD/../db_plugin/capnp
|
||||
DEPENDPATH += $$PWD/../db_plugin
|
||||
LIBS += -L$$DESTDIR/../db_plugins -llstream
|
||||
|
||||
!isEmpty(RPATH) {
|
||||
QMAKE_RPATHDIR += $$RPATH/db_plugins
|
||||
}
|
||||
|
||||
HEADERS = \
|
||||
layLStreamReaderPlugin.h \
|
||||
layLStreamWriterPlugin.h \
|
||||
|
||||
SOURCES = \
|
||||
layLStreamReaderPlugin.cc \
|
||||
layLStreamWriterPlugin.cc \
|
||||
|
||||
FORMS = \
|
||||
LStreamWriterOptionPage.ui \
|
||||
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
|
||||
!msvc {
|
||||
|
||||
# capnp needs C++ 14 in version 1.0.1
|
||||
# Qt6 comes with C++ 17 requirement.
|
||||
equals(HAVE_QT, "0") || lessThan(QT_MAJOR_VERSION, 6) {
|
||||
QMAKE_CXXFLAGS += -std=c++14
|
||||
}
|
||||
|
||||
# capnp runtimes have some unused arguments
|
||||
QMAKE_CXXFLAGS += \
|
||||
-Wno-unused-parameter
|
||||
}
|
||||
|
||||
INCLUDEPATH += $$PWD/runtime/capnp $$PWD/runtime/kj
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
|
||||
TEMPLATE = subdirs
|
||||
|
||||
!equals(HAVE_LSTREAM, "0") {
|
||||
|
||||
SUBDIRS = runtime db_plugin unit_tests
|
||||
db_plugin.depends += runtime
|
||||
unit_tests.depends += db_plugin
|
||||
|
||||
!equals(HAVE_QT, "0") {
|
||||
SUBDIRS += lay_plugin
|
||||
lay_plugin.depends += db_plugin
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
|
||||
# Cap'n'Proto runtime libraries
|
||||
|
||||
This code reflects version 1.0.1 of the kj and capnp library.
|
||||
|
||||
The "fetch.sh" script is used to populate this folder and to
|
||||
adapt the original project to qmake.
|
||||
|
||||
The original license files are found here:
|
||||
|
||||
capnp/LICENSE
|
||||
kj/LICENSE
|
||||
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
|
||||
TEMPLATE = lib
|
||||
DESTDIR = $$OUT_PWD/../../../../..
|
||||
INCLUDEPATH =
|
||||
|
||||
include($$PWD/../../lstream.pri)
|
||||
include($$PWD/capnp.pri)
|
||||
|
||||
TARGET = xcapnp
|
||||
CONFIG += staticlib
|
||||
SOURCES = $$CAPNP_SOURCES
|
||||
HEADERS = $$CAPNP_HEADERS
|
||||
|
||||
DEFINES += CAPNP_LITE
|
||||
LIBS =
|
||||
QT =
|
||||
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
The following people have made large code contributions to this repository.
|
||||
Those contributions are copyright the respective authors and licensed by them
|
||||
under the same MIT license terms as the rest of the library.
|
||||
|
||||
Kenton Varda <kenton@sandstorm.io> <kenton@cloudflare.com>: Primary Author
|
||||
Jason Choy <jjwchoy@gmail.com>: kj/threadlocal.h and other iOS tweaks, `name` annotation in C++ code generator
|
||||
Remy Blank <rblank@google.com> (contributions copyright Google Inc.): KJ Timers
|
||||
Joshua Warner <joshuawarner32@gmail.com>: cmake build, AnyStruct/AnyList, other stuff
|
||||
Scott Purdy <scott@fer.io>: kj/std iostream interface
|
||||
Bryan Borham <bjboreham@gmail.com>: Initial MSVC support
|
||||
Philip Quinn <p@partylemon.com>: cmake build and other assorted bits
|
||||
Brian Taylor <el.wubo@gmail.com>: emacs syntax highlighting
|
||||
Ben Laurie <ben@links.org>: discovered and responsibly disclosed security bugs
|
||||
Kamal Marhubi <kamal@marhubi.com>: JSON parser
|
||||
Oliver Kuckertz <oliver.kuckertz@mologie.de>: FdObserver POLLPRI support
|
||||
Harris Hancock <vortrab@gmail.com>: MSVC support
|
||||
Branislav Katreniak <branislav.katreniak@digitalstrom.com>: JSON decode
|
||||
Matthew Maurer <matthew.r.maurer@gmail.com>: Canonicalization Support
|
||||
David Renshaw <david@sandstorm.io>: bugfixes and miscellaneous maintenance
|
||||
Ingvar Stepanyan <me@rreverser.com> <ingvar@cloudflare.com>: Custom handlers for JSON decode
|
||||
|
||||
This file does not list people who maintain their own Cap'n Proto
|
||||
implementations as separate projects. Those people are awesome too! :)
|
||||
|
|
@ -0,0 +1,24 @@
|
|||
Copyright (c) 2013-2017 Sandstorm Development Group, Inc.; Cloudflare, Inc.;
|
||||
and other contributors. Each commit is copyright by its respective author or
|
||||
author's employer.
|
||||
|
||||
Licensed under the MIT License:
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
|
||||
|
|
@ -0,0 +1,43 @@
|
|||
|
||||
CAPNP_SOURCES=\
|
||||
capnp/c++.capnp.cc \
|
||||
capnp/blob.cc \
|
||||
capnp/arena.cc \
|
||||
capnp/layout.cc \
|
||||
capnp/list.cc \
|
||||
capnp/any.cc \
|
||||
capnp/message.cc \
|
||||
capnp/schema.capnp.cc \
|
||||
capnp/stream.capnp.cc \
|
||||
capnp/serialize.cc \
|
||||
capnp/serialize-packed.cc \
|
||||
|
||||
CAPNP_HEADERS=\
|
||||
capnp/arena.h \
|
||||
capnp/c++.capnp.h \
|
||||
capnp/common.h \
|
||||
capnp/blob.h \
|
||||
capnp/endian.h \
|
||||
capnp/layout.h \
|
||||
capnp/orphan.h \
|
||||
capnp/list.h \
|
||||
capnp/any.h \
|
||||
capnp/message.h \
|
||||
capnp/capability.h \
|
||||
capnp/membrane.h \
|
||||
capnp/dynamic.h \
|
||||
capnp/schema.h \
|
||||
capnp/schema.capnp.h \
|
||||
capnp/stream.capnp.h \
|
||||
capnp/schema-lite.h \
|
||||
capnp/schema-loader.h \
|
||||
capnp/schema-parser.h \
|
||||
capnp/pretty-print.h \
|
||||
capnp/serialize.h \
|
||||
capnp/serialize-async.h \
|
||||
capnp/serialize-packed.h \
|
||||
capnp/serialize-text.h \
|
||||
capnp/pointer-helpers.h \
|
||||
capnp/generated-header-support.h \
|
||||
capnp/raw-schema.h \
|
||||
capnp/compat/std-iterator.h \
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
# DO NOT EDIT!
|
||||
# (SEE ../capnp.pro)
|
||||
|
||||
|
||||
TEMPLATE = lib
|
||||
DESTDIR = $$OUT_PWD/../../../../..
|
||||
INCLUDEPATH =
|
||||
|
||||
include($$PWD/../../lstream.pri)
|
||||
include($$PWD/capnp.pri)
|
||||
|
||||
TARGET = xcapnp
|
||||
CONFIG += staticlib
|
||||
SOURCES = $$CAPNP_SOURCES
|
||||
HEADERS = $$CAPNP_HEADERS
|
||||
|
||||
DEFINES += CAPNP_LITE
|
||||
LIBS =
|
||||
QT =
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue