Intel(R) Threading Building Blocks Doxygen Documentation  version 4.2.3
tbb::flow::interface11::opencl_program< Factory >::file_reader Class Reference
Collaboration diagram for tbb::flow::interface11::opencl_program< Factory >::file_reader:

Public Member Functions

 file_reader (const std::string &filepath)
 
const char * content ()
 
size_t length ()
 

Private Attributes

std::string my_content
 

Detailed Description

template<typename Factory = opencl_info::default_opencl_factory>
class tbb::flow::interface11::opencl_program< Factory >::file_reader

Definition at line 1257 of file flow_graph_opencl_node.h.

Constructor & Destructor Documentation

◆ file_reader()

template<typename Factory = opencl_info::default_opencl_factory>
tbb::flow::interface11::opencl_program< Factory >::file_reader::file_reader ( const std::string &  filepath)
inline

Definition at line 1259 of file flow_graph_opencl_node.h.

1259  {
1260  std::ifstream file_descriptor( filepath, std::ifstream::binary );
1261  if ( !file_descriptor.is_open() ) {
1262  std::string str = std::string( "Could not open file: " ) + filepath;
1263  std::cerr << str << std::endl;
1264  throw str;
1265  }
1266  file_descriptor.seekg( 0, file_descriptor.end );
1267  size_t length = size_t( file_descriptor.tellg() );
1268  file_descriptor.seekg( 0, file_descriptor.beg );
1269  my_content.resize( length );
1270  char* begin = &*my_content.begin();
1271  file_descriptor.read( begin, length );
1272  file_descriptor.close();
1273  }

References begin, tbb::flow::interface11::opencl_program< Factory >::file_reader::length(), and tbb::flow::interface11::opencl_program< Factory >::file_reader::my_content.

Here is the call graph for this function:

Member Function Documentation

◆ content()

template<typename Factory = opencl_info::default_opencl_factory>
const char* tbb::flow::interface11::opencl_program< Factory >::file_reader::content ( )
inline

Definition at line 1274 of file flow_graph_opencl_node.h.

1274 { return &*my_content.cbegin(); }

References tbb::flow::interface11::opencl_program< Factory >::file_reader::my_content.

Referenced by tbb::flow::interface11::opencl_program< Factory >::init().

Here is the caller graph for this function:

◆ length()

template<typename Factory = opencl_info::default_opencl_factory>
size_t tbb::flow::interface11::opencl_program< Factory >::file_reader::length ( )
inline

Definition at line 1275 of file flow_graph_opencl_node.h.

1275 { return my_content.length(); }

References tbb::flow::interface11::opencl_program< Factory >::file_reader::my_content.

Referenced by tbb::flow::interface11::opencl_program< Factory >::file_reader::file_reader(), and tbb::flow::interface11::opencl_program< Factory >::init().

Here is the caller graph for this function:

Member Data Documentation

◆ my_content


The documentation for this class was generated from the following file:
begin
void const char const char int ITT_FORMAT __itt_group_sync x void const char ITT_FORMAT __itt_group_sync s void ITT_FORMAT __itt_group_sync p void ITT_FORMAT p void ITT_FORMAT p no args __itt_suppress_mode_t unsigned int void size_t ITT_FORMAT d void ITT_FORMAT p void ITT_FORMAT p __itt_model_site __itt_model_site_instance ITT_FORMAT p __itt_model_task __itt_model_task_instance ITT_FORMAT p void ITT_FORMAT p void ITT_FORMAT p void size_t ITT_FORMAT d void ITT_FORMAT p const wchar_t ITT_FORMAT s const char ITT_FORMAT s const char ITT_FORMAT s const char ITT_FORMAT s no args void ITT_FORMAT p size_t ITT_FORMAT d no args const wchar_t const wchar_t ITT_FORMAT s __itt_heap_function void size_t int ITT_FORMAT d __itt_heap_function void ITT_FORMAT p __itt_heap_function void void size_t int ITT_FORMAT d no args no args unsigned int ITT_FORMAT u const __itt_domain __itt_id ITT_FORMAT lu const __itt_domain __itt_id __itt_id __itt_string_handle ITT_FORMAT p const __itt_domain __itt_id ITT_FORMAT p const __itt_domain __itt_id __itt_timestamp begin
Definition: ittnotify_static.h:167
tbb::flow::interface11::opencl_program::file_reader::my_content
std::string my_content
Definition: flow_graph_opencl_node.h:1277
tbb::flow::interface11::opencl_program::file_reader::length
size_t length()
Definition: flow_graph_opencl_node.h:1275

Copyright © 2005-2019 Intel Corporation. All Rights Reserved.

Intel, Pentium, Intel Xeon, Itanium, Intel XScale and VTune are registered trademarks or trademarks of Intel Corporation or its subsidiaries in the United States and other countries.

* Other names and brands may be claimed as the property of others.