Next: , Previous: method Constructors, Up: The method Class



4.1.3 Other functions

— Function: const char* method::name (void) const;

This returns the base name of the method. Note that this may be an empty string, for example in Little Bob.

— Function: void method::name (const char* name);
— Function: void method::name (const string& name);

This sets the base name of the method to name.

— Function: int method::bells (void) const;

This returns the number of bells on which the method is defined.

— Function: int method::length (void) const;

This returns the number of changes in a lead of the method.

— Function: void method::push_back (const change& c);
— Function: void method::push_back (const string& s);

These utility functions add a change to the end of the method. In the first case, c is the change to be added; in the second case, s is place notation for the change to be added.

— Function: row method::lh (void) const;

This returns the first lead head of the method.

— Function: bool method::issym (void) const;

This returns true if the method is symmetrical about the half lead (and has an even number of changes in the lead), or false otherwise.

— Function: bool method::isdouble (void) const;

This returns true if the method is double, or false otherwise. Note that double does not imply symmetrical.

— Function: bool method::isregular (void) const;

This returns true if the method is regular (that is, has Plain Bob lead heads), or false otherwise.

— Function: int method::huntbells (void) const;

This returns the number of hunt bells in the method.

— Function: int method::leads (void) const;

This returns the number of leads in the plain course of the method.

— Function: char* method::lhcode (void) const;

This returns the standard code for the lead end and lead head of the method. The result is stored in a static internal buffer.

— Function: bool method::issym (bell b) const;

This returns true if the path of bell b in a lead of the method is symmetrical about the half lead, or false otherwise.

— Function: bool method::isplain (bell b = 0) const;

This returns true if bell b plain hunts for the whole lead of the method, or false otherwise.

— Function: bool method::hasdodges (bell b) const;

This returns true if bell b dodges during the lead, or false otherwise.

— Function: bool method::hasplaces (bell b) const;

This returns true if bell b makes any internal places during the lead, or false otherwise.

— Function: int method::methclass (void) const;

This function returns an integer which depends on the class of the method. The following values are defined:

          enum method::m_class {
            M_UNKNOWN, M_PRINCIPLE, M_BOB, M_PLACE, M_TREBLE_BOB, M_SURPRISE,
            M_DELIGHT, M_TREBLE_PLACE, M_ALLIANCE, M_HYBRID, M_SLOW_COURSE,
            M_MASK = 0x0f,
            M_DIFFERENTIAL = 0x10,
            M_LITTLE = 0x80
          };
     

The M_DIFFERENTIAL and M_LITTLE bits are flags which will be either set or cleared accordingly. (For the purpose of this function, “Differential” is considered a method class. Differential hunters will have the M_DIFFERENTIAL bit set, together with one of the other classes; differential methods will return M_DIFFERENTIAL | M_PRINCIPLE.)

— Function: char* method::fullname (char* buffer) const;

This function places the full name of the method in buffer, which should be long enough to receive it, and returns a pointer to it. The full name consists of:

Note that Grandsire, Union and their related methods are treated specially: the full name of these methods does not include their class, nor in the case of Little Grandsire does it contain “Little”.

— Function: string method::fullname (void) const;

This function returns the full name of the method as a string.

— Function: int method::maxblows (void) const;

This function returns the maximum consecutive blows made in any place in this method. (If the method has one bell fixed throughout, the lead length is returned.)