AndroMeta  2.0.0
Public Member Functions
Meta::MPackage Class Reference

Used to package a set of files to be run by the peer-to-peer system. More...

#include <MPackage.h>

Inheritance diagram for Meta::MPackage:
Meta::MObjectBase

List of all members.

Public Member Functions

 MPackage ()
 MPackage (const mvar &v, RestoreOpt opt)
 MPackage (mnode n)
 MPackage (const MPackage &p)
 MPackage (int commandId, const mvar &args)
 ~MPackage ()
void store (mvar &v) const
bool addFiles (const mstr &path, const mstr &fileRegex=".*")
bool addFile (const mstr &path)
mvec files () const
bool unpack (const mstr &path)
long size () const
int run (const mstr &runPath, const mvar &params, bool thread=true)
MPackageoperator= (const MPackage &package)

Detailed Description

Used to package a set of files to be run by the peer-to-peer system.


Constructor & Destructor Documentation

Constructor.

Meta::MPackage::MPackage ( const mvar v,
RestoreOpt  opt 
)

Restore constructor.

Construct a package from a node.

Copy constructor.

Meta::MPackage::MPackage ( int  commandId,
const mvar args 
)

Construct a package from a predefined AndroMeta command.

Destructor.


Member Function Documentation

bool Meta::MPackage::addFile ( const mstr path)

Add all files in the specified path.

bool Meta::MPackage::addFiles ( const mstr path,
const mstr fileRegex = ".*" 
)

Selectively add files in the specified path matching regex.

Parameters:
regex,e.g,:"Makefile|.*\\.cpp|.*\\.h|.*\\.mml|metac\\.conf"
Returns:
true on success.
Returns:
a list of filenames in the package.
int Meta::MPackage::run ( const mstr runPath,
const mvar params,
bool  thread = true 
)

Run an unpacked package in the specified path.

Parameters:
paramsA mapping of the command-line args. e.g: [x:1, type:"test"]
threadtrue if this command should run in a separate thread.
long Meta::MPackage::size ( ) const
Returns:
The size in bytes of the packed package.
void Meta::MPackage::store ( mvar v) const [virtual]

Store package to v.

Reimplemented from Meta::MObjectBase.

bool Meta::MPackage::unpack ( const mstr path)

Unpack to files into path.

Returns:
true on success.

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