OmniSciDB  a5dc49c757
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
TableFunctionsFactory_linker.GenerateAddTableFunctionsFiles Class Reference
+ Inheritance diagram for TableFunctionsFactory_linker.GenerateAddTableFunctionsFiles:
+ Collaboration diagram for TableFunctionsFactory_linker.GenerateAddTableFunctionsFiles:

Public Member Functions

def __init__
 
def filename_prefix
 
def get_filename
 
def should_generate_files
 
- Public Member Functions inherited from TableFunctionsFactory_linker.BaseGenerateFiles
def __init__
 
def file_counter
 
def generated_header_files
 
def increment_file_counter
 
def should_generate_files
 
def get_filename
 
def get_num_generated_files
 
def generate_files
 

Public Attributes

 stmts
 
 header_file
 
- Public Attributes inherited from TableFunctionsFactory_linker.BaseGenerateFiles
 dirname
 
 kind
 

Private Member Functions

def _generate_cpp_content
 
def _generate_hpp_content
 

Static Private Attributes

int _file_counter = -1
 

Additional Inherited Members

- Static Public Attributes inherited from TableFunctionsFactory_linker.BaseGenerateFiles
int CHUNK_SIZE = 200
 

Detailed Description

Definition at line 149 of file TableFunctionsFactory_linker.py.

Constructor & Destructor Documentation

def TableFunctionsFactory_linker.GenerateAddTableFunctionsFiles.__init__ (   self,
  dirname,
  stmts,
  header_file 
)

Definition at line 153 of file TableFunctionsFactory_linker.py.

154  def __init__(self, dirname, stmts, header_file):
155  self.stmts = stmts
156  self.header_file = header_file
157  super(GenerateAddTableFunctionsFiles, self).__init__(dirname=dirname, kind="")

Member Function Documentation

def TableFunctionsFactory_linker.GenerateAddTableFunctionsFiles._generate_cpp_content (   self,
  chunk,
  hpp_filename,
  fileno 
)
private

Definition at line 168 of file TableFunctionsFactory_linker.py.

References join().

Referenced by TableFunctionsFactory_linker.BaseGenerateFiles._generate_files().

169  def _generate_cpp_content(self, chunk, hpp_filename, fileno):
170  content = """
171  /*
172  This file is generated by %s. Do no edit!
173  */
174 
175  #include "QueryEngine/TableFunctions/TableFunctionsFactory.h"
176  #include "%s"
177 
178  namespace table_functions {
179 
180  NO_OPT_ATTRIBUTE void add_table_functions_%d() {
181  %s
182  }
183  };
184 
185  """
186  content = textwrap.dedent(content)
187  chunk = '\n '.join(chunk)
188  return content % (sys.argv[0], hpp_filename, fileno, chunk)
std::string join(T const &container, std::string const &delim)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

def TableFunctionsFactory_linker.GenerateAddTableFunctionsFiles._generate_hpp_content (   self,
  funcs,
  fileno 
)
private

Definition at line 189 of file TableFunctionsFactory_linker.py.

References TableFunctionsFactory_linker.GenerateTemplateFiles.header_file, and TableFunctionsFactory_linker.GenerateAddTableFunctionsFiles.header_file.

Referenced by TableFunctionsFactory_linker.BaseGenerateFiles._generate_files().

190  def _generate_hpp_content(self, funcs, fileno):
191  content = """
192  /*
193  This file is generated by %s. Do no edit!
194  */
195 
196  #include "QueryEngine/TableFunctions/TableFunctionsFactory.h"
197  #include "%s"
198 
199  #if defined(__clang__)
200  #define NO_OPT_ATTRIBUTE __attribute__((optnone))
201 
202  #elif defined(__GNUC__) || defined(__GNUG__)
203  #define NO_OPT_ATTRIBUTE __attribute((optimize("O0")))
204 
205  #elif defined(_MSC_VER)
206  #define NO_OPT_ATTRIBUTE
207 
208  #endif
209 
210  namespace table_functions {
211  NO_OPT_ATTRIBUTE void add_table_functions_%s();
212  };
213  """
214 
215  content = textwrap.dedent(content)
216  return content % (sys.argv[0], self.header_file, fileno)

+ Here is the caller graph for this function:

def TableFunctionsFactory_linker.GenerateAddTableFunctionsFiles.filename_prefix (   self)

Definition at line 159 of file TableFunctionsFactory_linker.py.

Referenced by TableFunctionsFactory_linker.BaseGenerateFiles._get_filename().

160  def filename_prefix(self):
161  return "TableFunctionsFactory_add"

+ Here is the caller graph for this function:

def TableFunctionsFactory_linker.GenerateAddTableFunctionsFiles.get_filename (   self,
  prefix,
  kind,
  fileno,
  ext 
)

Definition at line 162 of file TableFunctionsFactory_linker.py.

163  def get_filename(self, prefix, kind, fileno, ext):
164  return "%s_%s.%s" % (prefix, fileno, ext)
def TableFunctionsFactory_linker.GenerateAddTableFunctionsFiles.should_generate_files (   self)

Definition at line 165 of file TableFunctionsFactory_linker.py.

References TableFunctionsFactory_linker.GenerateTemplateFiles.stmts, and TableFunctionsFactory_linker.GenerateAddTableFunctionsFiles.stmts.

166  def should_generate_files(self):
167  return len(self.stmts) > 0

Member Data Documentation

int TableFunctionsFactory_linker.GenerateAddTableFunctionsFiles._file_counter = -1
staticprivate

Definition at line 151 of file TableFunctionsFactory_linker.py.

TableFunctionsFactory_linker.GenerateAddTableFunctionsFiles.header_file

Definition at line 155 of file TableFunctionsFactory_linker.py.

Referenced by TableFunctionsFactory_linker.GenerateAddTableFunctionsFiles._generate_hpp_content().

TableFunctionsFactory_linker.GenerateAddTableFunctionsFiles.stmts

Definition at line 154 of file TableFunctionsFactory_linker.py.

Referenced by TableFunctionsFactory_linker.BaseGenerateFiles._split_stmts_into_chunks(), and TableFunctionsFactory_linker.GenerateAddTableFunctionsFiles.should_generate_files().


The documentation for this class was generated from the following file: