Boost C++ Libraries

PrevUpHomeNext

Builtin classes

Class abstract-target
Class project-target
Class main-target
Class basic-target
Class typed-target
Class property-set

Class abstract-target

Base class for all abstract targets.

class abstract-target {
    rule __init__ ( name : project )
    rule name ( )
    rule project ( )
    rule location ( )
    rule full-name ( )
    rule generate ( property-set )
}

Classes derived from abstract-target:

  1. rule __init__ ( name : project )

    name

    The name of the target in the Jamfile.

    project

    The project to which this target belongs.

  2. rule name ( )

    Returns the name of this target.

  3. rule project ( )

    Returns the project for this target.

  4. rule location ( )

    Returns the location where the target was declared.

  5. rule full-name ( )

    Returns a user-readable name for this target.

  6. rule generate ( property-set )

    Generates virtual targets for this abstract target using the specified properties, unless a different value of some feature is required by the target. This is an abstract method which must be overriden by derived classes.

    On success, returns:

    • a property-set with the usage requirements to be applied to dependents
    • a list of produced virtual targets, which may be empty.

    If property-set is empty, performs the default build of this target, in a way specific to the derived class.

Class project-target

class project-target : abstract-target {
    rule generate ( property-set )
    rule build-dir ( )
    rule main-target ( name )
    rule has-main-target ( name )
    rule find ( id : no-error ? )

    # Methods inherited from abstract-target
    rule name ( )
    rule project ( )
    rule location ( )
    rule full-name ( )
}

This class has the following responsibilities:

  • Maintaining a list of main targets in this project and building them.

  1. rule generate ( property-set )

    Overrides abstract-target.generate. Generates virtual targets for all the targets contained in this project.

    On success, returns:

    • a property-set with the usage requirements to be applied to dependents
    • a list of produced virtual targets, which may be empty.

  2. rule build-dir ( )

    Returns the root build directory of the project.

  3. rule main-target ( name )

    Returns a main-target class instance corresponding to name. Can only be called after the project has been fully loaded.

  4. rule has-main-target ( name )

    Returns whether a main-target with the specified name exists. Can only be called after the project has been fully loaded.

  5. rule find ( id : no-error ? )

    Find and return the target with the specified id, treated relative to self. Id may specify either a target or a file name with the target taking priority. May report an error or return nothing if the target is not found depending on the no-error parameter.

Class main-target

class main-target : abstract-target {
    rule generate ( property-set )

    # Methods inherited from abstract-target
    rule name ( )
    rule project ( )
    rule location ( )
    rule full-name ( )
}

A main-target represents a named top-level target in a Jamfile.

  1. rule generate ( property-set )

    Overrides abstract-target.generate. Select an alternative for this main target, by finding all alternatives whose requirements are satisfied by property-set and picking the one with the longest requirements set. Returns the result of calling generate on that alternative.

    On success, returns:

    • a property-set with the usage requirements to be applied to dependents
    • a list of produced virtual targets, which may be empty.

Class basic-target

class basic-target : abstract-target {
    rule __init__ ( name : project : sources * : requirements * : default-build * : usage-requirements * )  
    rule generate ( property-set )
    rule construct ( name : source-targets * : property-set )

    # Methods inherited from abstract-target
    rule name ( )
    rule project ( )
    rule location ( )
    rule full-name ( )
}

Implements the most standard way of constructing main target alternative from sources. Allows sources to be either files or other main targets and handles generation of those dependency targets.

  1. rule __init__ ( name : project : sources * : requirements * : default-build * : usage-requirements * )

    name

    The name of the target

    project

    The project in which the target is declared.

  2. rule generate ( property-set )

    Overrides abstract-target.generate. Determines final build properties, generates sources, and calls construct. This method should not be overridden.

    On success, returns:

    • a property-set with the usage requirements to be applied to dependents
    • a list of produced virtual targets, which may be empty.

  3. rule construct ( name : source-targets * : property-set )

    Constructs virtual targets for this abstract target. Returns a usage-requirements property-set and a list of virtual targets. Should be overriden in derived classes.

Class typed-target

class typed-target : basic-target {
    rule __init__ ( name : project : type : sources * : requirements * : default-build * : usage-requirements * ) 
    rule type ( )
    rule construct ( name : source-targets * : property-set )

    # Methods inherited from abstract-target
    rule name ( )
    rule project ( )
    rule location ( )
    rule full-name ( )
    
    # Methods inherited from basic-target
    rule generate ( property-set )
  }

typed-target is the most common kind of target alternative. Rules for creating typed targets are defined automatically for each type.

  1. rule __init__ ( name : project : type : sources * : requirements * : default-build * : usage-requirements * )

    name

    The name of the target

    project

    The project in which the target is declared.

    type

    The type of the target.

  2. rule type ( )

    Returns the type of the target.

  3. rule construct ( name : source-targets * : property-set )

    Implements basic-target.construct. Attempts to create a target of the correct type using generators appropriate for the given property-set. Returns a property-set containing the usage requirements and a list of virtual targets.

    Note

    This function is invoked automatically by basic-target.generate and should not be called directly by users.

Class property-set

Class for storing a set of properties.

class property-set {
    rule raw ( )
    rule str ( )
    rule propagated ( )
    rule add ( ps )
    rule add-raw ( properties * )
    rule refine ( ps )
    rule get ( feature )
}

There is 1<->1 correspondence between identity and value. No two instances of the class are equal. To maintain this property, the 'property-set.create' rule should be used to create new instances. Instances are immutable.

  1. rule raw ( )

    Returns a Jam list of the stored properties.

  2. rule str ( )

    Returns the string repesentation of the stored properties.

  3. rule propagated ( )

    Returns a property-set containing all the propagated properties in this property-set.

  4. rule add ( ps )

    Returns a new property-set containing the union of the properties in this property-set and in ps.

    Note

    If ps contains non-free properties that should override the values in this object, use refine instead.

  5. rule add-raw ( properties * )

    Link add, except that it takes a list of properties instead of a property-set.

  6. rule refine ( ps )

    Refines properties by overriding any non-free and non-conditional properties for which a different value is specified in ps. Returns the resulting property-set.

  7. rule get ( feature )

    Returns all the values of feature.


PrevUpHomeNext