Bitcoin Core 29.99.0
P2P Digital Currency
Classes | Macros | Typedefs | Functions | Variables
gen.cpp File Reference
#include <mp/config.h>
#include <mp/util.h>
#include <algorithm>
#include <capnp/schema-parser.h>
#include <cstdint>
#include <cstdio>
#include <cstdlib>
#include <errno.h>
#include <fstream>
#include <functional>
#include <iostream>
#include <kj/array.h>
#include <kj/common.h>
#include <kj/filesystem.h>
#include <kj/memory.h>
#include <kj/string.h>
#include <map>
#include <set>
#include <sstream>
#include <stdexcept>
#include <string>
#include <system_error>
#include <unistd.h>
#include <vector>
Include dependency graph for gen.cpp:

Go to the source code of this file.

Classes

struct  Format
 

Macros

#define PROXY_BIN   "mpgen"
 
#define PROXY_DECL   "mp/proxy.h"
 
#define PROXY_TYPES   "mp/proxy-types.h"
 

Typedefs

using CharSlice = kj::ArrayPtr< const char >
 

Functions

template<typename Reader >
static bool AnnotationExists (const Reader &reader, uint64_t id)
 
template<typename Reader >
static bool GetAnnotationText (const Reader &reader, uint64_t id, kj::StringPtr *result)
 
template<typename Reader >
static bool GetAnnotationInt32 (const Reader &reader, uint64_t id, int32_t *result)
 
static void ForEachMethod (const capnp::InterfaceSchema &interface, const std::function< void(const capnp::InterfaceSchema &interface, const capnp::InterfaceSchema::Method)> &callback)
 
template<class OutputStream , class Array , const char * Enable = decltype(std::declval<Array>().begin())()>
static OutputStream & operator<< (OutputStream &os, const Array &array)
 
static std::string Cap (kj::StringPtr str)
 
static bool BoxedType (const ::capnp::Type &type)
 
static void Generate (kj::StringPtr src_prefix, kj::StringPtr include_prefix, kj::StringPtr src_file, const std::vector< kj::StringPtr > &import_paths, const kj::ReadableDirectory &src_dir, const std::vector< kj::Own< const kj::ReadableDirectory > > &import_dirs)
 
int main (int argc, char **argv)
 

Variables

constexpr uint64_t NAMESPACE_ANNOTATION_ID = 0xb9c6f99ebf805f2cull
 
constexpr uint64_t INCLUDE_ANNOTATION_ID = 0xb899f3c154fdb458ull
 
constexpr uint64_t INCLUDE_TYPES_ANNOTATION_ID = 0xbcec15648e8a0cf1ull
 
constexpr uint64_t WRAP_ANNOTATION_ID = 0xe6f46079b7b1405eull
 
constexpr uint64_t COUNT_ANNOTATION_ID = 0xd02682b319f69b38ull
 
constexpr uint64_t EXCEPTION_ANNOTATION_ID = 0x996a183200992f88ull
 
constexpr uint64_t NAME_ANNOTATION_ID = 0xb594888f63f4dbb9ull
 
constexpr uint64_t SKIP_ANNOTATION_ID = 0x824c08b82695d8ddull
 

Macro Definition Documentation

◆ PROXY_BIN

#define PROXY_BIN   "mpgen"

Definition at line 31 of file gen.cpp.

◆ PROXY_DECL

#define PROXY_DECL   "mp/proxy.h"

Definition at line 32 of file gen.cpp.

◆ PROXY_TYPES

#define PROXY_TYPES   "mp/proxy-types.h"

Definition at line 33 of file gen.cpp.

Typedef Documentation

◆ CharSlice

using CharSlice = kj::ArrayPtr<const char>

Definition at line 89 of file gen.cpp.

Function Documentation

◆ AnnotationExists()

template<typename Reader >
static bool AnnotationExists ( const Reader &  reader,
uint64_t  id 
)
static

Definition at line 45 of file gen.cpp.

Here is the caller graph for this function:

◆ BoxedType()

static bool BoxedType ( const ::capnp::Type &  type)
static

Definition at line 118 of file gen.cpp.

Here is the caller graph for this function:

◆ Cap()

static std::string Cap ( kj::StringPtr  str)
static

Definition at line 111 of file gen.cpp.

Here is the caller graph for this function:

◆ ForEachMethod()

static void ForEachMethod ( const capnp::InterfaceSchema &  interface,
const std::function< void(const capnp::InterfaceSchema &interface, const capnp::InterfaceSchema::Method)> &  callback 
)
static

Definition at line 79 of file gen.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Generate()

static void Generate ( kj::StringPtr  src_prefix,
kj::StringPtr  include_prefix,
kj::StringPtr  src_file,
const std::vector< kj::StringPtr > &  import_paths,
const kj::ReadableDirectory &  src_dir,
const std::vector< kj::Own< const kj::ReadableDirectory > > &  import_dirs 
)
static

Definition at line 138 of file gen.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetAnnotationInt32()

template<typename Reader >
static bool GetAnnotationInt32 ( const Reader &  reader,
uint64_t  id,
int32_t *  result 
)
static

Definition at line 68 of file gen.cpp.

Here is the caller graph for this function:

◆ GetAnnotationText()

template<typename Reader >
static bool GetAnnotationText ( const Reader &  reader,
uint64_t  id,
kj::StringPtr *  result 
)
static

Definition at line 56 of file gen.cpp.

Here is the caller graph for this function:

◆ main()

int main ( int  argc,
char **  argv 
)

Definition at line 638 of file gen.cpp.

Here is the call graph for this function:

◆ operator<<()

template<class OutputStream , class Array , const char * Enable = decltype(std::declval<Array>().begin())()>
static OutputStream & operator<< ( OutputStream &  os,
const Array &  array 
)
static

Definition at line 93 of file gen.cpp.

Variable Documentation

◆ COUNT_ANNOTATION_ID

constexpr uint64_t COUNT_ANNOTATION_ID = 0xd02682b319f69b38ull
constexpr

Definition at line 39 of file gen.cpp.

◆ EXCEPTION_ANNOTATION_ID

constexpr uint64_t EXCEPTION_ANNOTATION_ID = 0x996a183200992f88ull
constexpr

Definition at line 40 of file gen.cpp.

◆ INCLUDE_ANNOTATION_ID

constexpr uint64_t INCLUDE_ANNOTATION_ID = 0xb899f3c154fdb458ull
constexpr

Definition at line 36 of file gen.cpp.

◆ INCLUDE_TYPES_ANNOTATION_ID

constexpr uint64_t INCLUDE_TYPES_ANNOTATION_ID = 0xbcec15648e8a0cf1ull
constexpr

Definition at line 37 of file gen.cpp.

◆ NAME_ANNOTATION_ID

constexpr uint64_t NAME_ANNOTATION_ID = 0xb594888f63f4dbb9ull
constexpr

Definition at line 41 of file gen.cpp.

◆ NAMESPACE_ANNOTATION_ID

constexpr uint64_t NAMESPACE_ANNOTATION_ID = 0xb9c6f99ebf805f2cull
constexpr

Definition at line 35 of file gen.cpp.

◆ SKIP_ANNOTATION_ID

constexpr uint64_t SKIP_ANNOTATION_ID = 0x824c08b82695d8ddull
constexpr

Definition at line 42 of file gen.cpp.

◆ WRAP_ANNOTATION_ID

constexpr uint64_t WRAP_ANNOTATION_ID = 0xe6f46079b7b1405eull
constexpr

Definition at line 38 of file gen.cpp.