Main Page | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members | Related Pages | Examples

sparkmacro.h File Reference

Header file defining the preprocessor macros required to build a static SPARK problem from the *.cpp file describing the problem topology. More...

#include "variable.h"
#include "callback.h"
#include "inverse.h"
#include "object.h"
#include "component.h"
#include "problem.h"
#include "sparkapi.h"
#include "spark.h"

Include dependency graph for sparkmacro.h:

Include dependency graph

Go to the source code of this file.

Defines

#define _QUOTE_(x)   #x
 Causes the corresponding actual argument to be enclosed in double quotation marks.

#define _NAMESPACE_(name)   _##name
 Prefixes name with underscore to make it a valid qualifier for a namespace.

#define START_ARRAY(size)
 Defines a non-empty array for elements of the pre-defined type element_type. See END_ARRAY.

#define END_ARRAY   };
 Defines the end of a non-empty array. See START_ARRAY.

#define EMPTY_ARRAY
 Defines an empty array of pre-defined type element_type.

#define START_PROBLEM(name)
 Starts the definition of a TProblem object named name. See END_PROBLEM.

#define END_PROBLEM
 Ends the definition of a TProblem object. Also takes care of registering the compiled problem pointer with SPARK environment. See START_PROBLEM.

#define START_INVERSES
 Start the declaration of list of inverse functions. See END_INVERSES.

#define END_INVERSES   };
 Terminates the declaration of the list of inverse functions. See START_INVERSES.


Detailed Description

Header file defining the preprocessor macros required to build a static SPARK problem from the *.cpp file describing the problem topology.

This file is included in the "problem.cpp" file by setupcpp. It defines the macros required to compile the problem. There is a one-to-one matching between the XML DTD used in the *.xml file and the preprocessor macros for each section. See the file "spark2.dtd" in the example section.

Author:
Dimitri Curtil (LBNL/SRG)
Date:
July 9, 2002
Attention:
PORTIONS COPYRIGHT (C) 2003 AYRES SOWELL ASSOCIATES, INC.
PORTIONS COPYRIGHT (C) 2003 THE REGENTS OF THE UNIVERSITY OF CALIFORNIA . PENDING APPROVAL BY THE US DEPARTMENT OF ENERGY. ALL RIGHTS RESERVED.

Define Documentation

#define _QUOTE_  )     #x
 

Causes the corresponding actual argument to be enclosed in double quotation marks.

#define _NAMESPACE_ name   )     _##name
 

Prefixes name with underscore to make it a valid qualifier for a namespace.

#define START_ARRAY size   ) 
 

Value:

const unsigned Size = size; \
        element_type Array[] = { \
Defines a non-empty array for elements of the pre-defined type element_type. See END_ARRAY.

#define END_ARRAY   };
 

Defines the end of a non-empty array. See START_ARRAY.

#define EMPTY_ARRAY
 

Value:

const unsigned Size = 0; \
        element_type* Array = 0; \
Defines an empty array of pre-defined type element_type.

#define START_PROBLEM name   ) 
 

Value:

namespace Problem__##name  {  \
                const char* Name = _QUOTE_(name); \
Starts the definition of a TProblem object named name. See END_PROBLEM.

#define END_PROBLEM
 

Value:

SPARK::TProblem Element( \
                        Inverses::Size, Inverses::Array, \
                        Variables::Size, Variables::Array, \
                        Components::Size, Components::Array \
                ); \
                bool IsRegistered = SPARK::Problem::RegisterStaticInstance( Name, &Element ); \
        }; \
Ends the definition of a TProblem object. Also takes care of registering the compiled problem pointer with SPARK environment. See START_PROBLEM.

#define START_INVERSES
 

Value:

namespace Inverses { \
        typedef SPARK::TInverse*  element_type; \
Start the declaration of list of inverse functions. See END_INVERSES.

#define END_INVERSES   };
 

Terminates the declaration of the list of inverse functions. See START_INVERSES.



Generated on 5 Nov 2003 for VisualSPARK 2.01