artifact_impl Class Reference

#include <artifact_impl.hpp>

List of all members.

Public Member Functions

 artifact_impl ()
 Default constructor.
 artifact_impl (std::string const &name)
 Constructor with an artifact name.
 ~artifact_impl ()
 Destructor.
void add_ref ()
 Increment the reference count.
void delete_ref ()
std::string const & name () const
 Return the artifact name.
std::time_t mod_time () const
 Return the modification time.
std::string expand (std::string str) const
void build ()
 "Build" the artifact.
std::time_t get_mod_time ()
void store_variable (std::string const &name, std::string const &value)


Detailed Description

Listing 60-7. Defining the Artifact Implementation Class Implementation of the artifact pimpl. This is where the real work takes place, plus managing the reference count.

Definition at line 15 of file artifact_impl.hpp.


Constructor & Destructor Documentation

artifact_impl::artifact_impl (  ) 

Default constructor.

See Listing 60-8.

Definition at line 7 of file artifact_impl.cpp.


Member Function Documentation

void artifact_impl::delete_ref (  ) 

Decrement the reference count. When the count reaches zero, destroy this object.

Definition at line 25 of file artifact_impl.cpp.

Referenced by artifact::operator=(), and artifact::~artifact().

std::string artifact_impl::expand ( std::string  str  )  const

Expand variable names in str. Each occurrence of is replaced by the value of the variable NAME in str. Look in the local variable map first, then in the global map.

Parameters:
str the string to expand

Definition at line 44 of file artifact_impl.cpp.

References expand().

Referenced by artifact::expand().

std::time_t artifact_impl::get_mod_time (  ) 

Return the modification time of the artifact. In real life, this would probably check the file's modification time.

Definition at line 53 of file artifact_impl.cpp.

Referenced by artifact::get_mod_time().

void artifact_impl::store_variable ( std::string const &  name,
std::string const &  value 
)

Store a variable in the local map.

Parameters:
name the variable name
value the replacement value of the variable

Definition at line 60 of file artifact_impl.cpp.

Referenced by artifact::store_variable().


The documentation for this class was generated from the following files:
Generated on Sun Nov 30 09:53:23 2008 for Exploring C++ - Final Forms of Key Examples by  doxygen 1.5.3