Parallel Make  1.0
My implementation of make utility, which can run in multiple threads according to user request.
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends
pmake Class Reference

Base class representing how make processes targets. More...

#include <pmake.hpp>

Public Types

using thread_type = my_thread< process_states(pmake *, makefile_record &)>
 
using pmake_variables = std::unordered_map< std::string, std::string >
 

Public Member Functions

 pmake ()
 Default empty constructor. More...
 
 pmake (pmake &&)=default
 Defaulted move constructor. More...
 
pmake & operator= (pmake &&other)
 Defaulted move assignment. More...
 
 pmake (const pmake &)=delete
 Deleted copy constructor. More...
 
pmake & operator= (const pmake &)=delete
 Deleted copy assignment. More...
 
 pmake (const std::vector< std::string > &makefile, pmake_options &&options, std::string &&exe_name)
 Constructor, allowing partialy parsed makefile, command line options, and exe_name to be passed. More...
 
void add_variable (const std::string &name, const std::string &value)
 
bool is_variable (const std::string &name) const
 
const std::string & get_variable (const std::string &name) const
 
void add_record (std::vector< std::string > &&targets, std::vector< std::string > &&dependencies, const pmake_options &options)
 
const std::string & get_exe_name () const
 
int run ()
 Starts processing targets. More...
 

Static Public Attributes

static const std::regex var_def
 Regex matching variable definition. More...
 
static const std::regex var_use
 Regex matching variable use. More...
 
static const std::regex target_def
 Regex matching rule definition. More...
 
static const std::regex command_def
 Regex matching command definition. More...
 
static const std::regex item_def
 Regex matching single item in rule. More...
 

Detailed Description

Base class representing how make processes targets.

!

Member Typedef Documentation

using pmake::pmake_variables = std::unordered_map<std::string, std::string>

Constructor & Destructor Documentation

pmake::pmake ( )
inline

Default empty constructor.

pmake::pmake ( pmake &&  )
default

Defaulted move constructor.

pmake::pmake ( const pmake &  )
delete

Deleted copy constructor.

pmake::pmake ( const std::vector< std::string > &  makefile,
pmake_options &&  options,
std::string &&  exe_name 
)

Constructor, allowing partialy parsed makefile, command line options, and exe_name to be passed.

Member Function Documentation

void pmake::add_record ( std::vector< std::string > &&  targets,
std::vector< std::string > &&  dependencies,
const pmake_options &  options 
)
inline

Constructs new record at the end of pmake::m_records.

Parameters
targetsstd::vector of names of targets.
dependenciesstd::vector of names of dependencies.
optionsconst reference to pmake_options.
void pmake::add_variable ( const std::string &  name,
const std::string &  value 
)
inline

Adds new variable. If value represented by key already is in list, it's value is redefined.

Parameters
namename of the variable.
valuevalue of the variable.
const std::string& pmake::get_exe_name ( ) const
inline

Gets executable name for POSIX like output.

Returns
const reference to executable name.
const std::string& pmake::get_variable ( const std::string &  name) const
inline

Gets value of variable by name.

Parameters
namename of the variable.
Returns
const reference to value of the variable.
bool pmake::is_variable ( const std::string &  name) const
inline

Checks whether given variable is in list.

Parameters
namevariable to be found.
Returns
true if such variable exists, false otherwise.
pmake& pmake::operator= ( pmake &&  other)
inline

Defaulted move assignment.

pmake& pmake::operator= ( const pmake &  )
delete

Deleted copy assignment.

int pmake::run ( )

Starts processing targets.

Member Data Documentation

const std::regex pmake::command_def
static

Regex matching command definition.

const std::regex pmake::item_def
static

Regex matching single item in rule.

const std::regex pmake::target_def
static

Regex matching rule definition.

const std::regex pmake::var_def
static

Regex matching variable definition.

const std::regex pmake::var_use
static

Regex matching variable use.


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