opl studio 3.7 component libraries reference manual

Upload: oldecop

Post on 02-Mar-2016

72 views

Category:

Documents


0 download

DESCRIPTION

Component Libraries Reference Manual

TRANSCRIPT

  • ILOG OPL Studio 3.7

    Component Libraries Reference Manual

    September 2003

    Copyright 1987-2003, by ILOG S.A. All rights reserved.

    ILOG, the ILOG design, CPLEX, and all other logos and product and service names of ILOG are registered trademarks or trademarks of ILOG in France, the U.S. and/or other countries.

    JavaTM and all Java-based marks are either trademarks or registered trademarks of Sun Microsystems, Inc. in the United States and other countries. Microsoft, Windows, and Windows NT are either trademarks or registered trademarks of Microsoft Corporation in the U.S. and other countries.

    All other brand, product and company names are trademarks or registered trademarks of their respective holders.

  • C O N T E N T SContents

    Component Libraries Reference Manual

    Preface Preface. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7

    What are the OPL Component Libraries? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .7How this Document is Organized . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .8What You Need to Know . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .8

    Notation and Naming Conventions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .8Related Documents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .9

    For More Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10

    Users Mailing List . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10Web Site. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11

    Part I The COM/ActiveX API . . . . . . . . . . . . . . . . . . . . . . . . . . . 15COPLscriptSolver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .17

    COPLsolver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .19IOPLactivity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .21I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L 3

    IOPLarray . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .22

    IOPLbasisStatus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .31IOPLchar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .32IOPLconstraint . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .33

  • C O N T E N T SIOPLdata . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .35

    IOPLenum . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .36IOPLenumIterator. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .40IOPLenumValue. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .42

    IOPLenumVar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .45IOPLerrorReporter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .46IOPLfloat . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .48

    IOPLfloatRange . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .49IOPLfloatVar. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .50IOPLint . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .52

    IOPLintRange. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .53IOPLintVar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .54

    IOPLscriptSolver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .55IOPLset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .58IOPLsetIterator. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .59

    IOPLsolver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .63IOPLstring . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .86IOPLstruct . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .87

    Part II The C++ API . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93OPLactivity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .94

    OPLalternativeResource . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .95OPLarray . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .96OPLbasisStatus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .104

    OPLchar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .105OPLconstraint . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .106OPLdata . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .108

    OPLdiscreteEnergy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .109OPLdiscreteResource . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .110OPLenum. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .111

    OPLenumIterator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1134I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L

  • C O N T E N T SOPLenumValue . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .114

    OPLenumVar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .116OPLerrorReporter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .117OPLfloat . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .119

    OPLfloatRange. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .120OPLfloatVar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .121OPLint . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .122

    OPLinternalError . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .123OPLintRange . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .124OPLintVar. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .125

    OPLreservoir . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .126OPLruntimeError . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .127

    OPLscriptSolver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .128OPLsemanticError . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .130OPLset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .131

    OPLsetIterator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .132OPLsolver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .135OPLstateResource. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .153

    OPLstring . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .154OPLstruct . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .155OPLsyntaxError . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .157

    OPLunaryResource . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .158

    Part III The Java API . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 161OPLactivity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .162OPLadaptable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .164OPLadaptor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .166

    OPLarray . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .174OPLbasisStatus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .180OPLchar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .181

    OPLconstraint . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .182I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L 5

  • C O N T E N T SOPLdata . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .184

    OPLenum. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .185OPLenumIterator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .187OPLenumValue . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .189

    OPLenumVar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .191OPLerrorReporter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .192OPLexception. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .194

    OPLfloat . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .195OPLfloatRange. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .196OPLfloatVar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .197

    OPLint . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .198OPLintRange . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .199OPLintVar. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .200OPLrequirement. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .202OPLrulesAdaptor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .204

    OPLscriptSolver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .207OPLset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .209OPLsetIterator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .210

    OPLsolver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .213OPLstring . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .229OPLstruct . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .230

    OPLsymmetricRequirement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .232

    Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2336I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L

  • P R E F A C EPreface

    This reference manual describes the ILOG OPL Component Libraries.

    What are the OPL Component Libraries?

    The ILOG OPL Component Libraries comprise different APIs that allow access to the OPL solving engine. These APIs include the Microsoft COM/ActiveX component, a C++ component and a Java component.

    The OPL engine is available as a COM/ActiveX component, through a dynamic library (oplServer.dll) on Windows platforms. Microsofts Component Object Model (COM) allows Windows users to access OPL from within languages such as I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L 7

    Visual Basic, C++, VBScript, JScript and Delphi.

    The OPL engine is available as a C++ component, through a static library on both UNIX platforms (libopl.a) and Windows platforms (opl.lib). The static library provides the same functionality as the COM component, and in addition accesses the underlying C++ library objects.

    The OPL engine is available as a Java component, through a dynamic library on both UNIX platforms (libopljni.so) and Windows platforms (opljni.dll).

  • How this Document is Organized

    This reference manual contains three parts, each one describing an interface to the OPL solving engine.

    Part 1 documents a COM/ActiveX layer on Microsoft Windows operating systems. For each COM interface, the manual gives:

    its description

    its synopsis in IDL (Interface Definition Language) separate language dependent synopses, in Visual Basic and C++

    a description of each member function.

    Part 2 documents the C++ interface.

    Part 3 documents the Java interface. The Java classes act as wrappers around the OPL solving engine and OPL declared entities.

    What You Need to Know

    This manual assumes that you can write Visual Basic, C++, or Java code and that you know the basic concepts of Microsoft COM/ActiveX and IDL (Interface Definition Language).

    Notation and Naming Conventions

    Throughout this manual, the following typographic conventions apply:

    Samples of code are written in this typeface.

    The names of member functions appear in this typeface in the section where they are documented.

    Important ideas are emphasized like this.

    The letters COPL prefix the names of the COM classes, also known as coclasses.

    The letters IOPL prefix the names of the COM interfaces.

    The letters OPL prefix the names of the C++ classes.8I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L

  • Related Documents

    The ILOG OPL Component Libraries come with:

    An online version of this reference manual in HTML. It is part of the standard distribution of the product, accessible through conventional HTML browsers.

    ILOG OPL Studio: Component Libraries Users Manual

    This document contains examples showing how to use the APIs in order to access OPL from Visual Basic, C++, and Java.

    ILOG OPL Studio: Language Manual

    This book, containing a description of the OPL programming language, is based on The OPL Optimization Programming Language by Pascal Van Hentenryck, published by The MIT Press, 1999, Cambridge, Massachusetts.

    ILOG OPL Studio: Language Quick ReferenceThis online document provides a handy reference to OPL and OPLScript syntax.

    ILOG OPL Studio: Users Manual

    Describes the graphical user interface for the OPL modeling language. All development effort is supported through the various modules accessible via ILOG OPL Studio.

    Source code for examples delivered in the standard distribution.

    A README file delivered as part of the standard distribution. This file contains the most recent information about platform prerequisites for the ILOG OPL Component Libraries.I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L 9

  • For More Information

    For technical support of ILOG OPL Component Libraries, you should contact your local distributor, or, if you are a direct ILOG customer, contact:

    We encourage you to use e-mail for faster, better service.

    Users Mailing ListThe electronic mailing list [email protected] is available for you to share your development experience with other OPL Studio users. This list is not moderated, but subscription is subject to an on-going maintenance contract. To subscribe to oplstudio-list, send e-mail without any subject to [email protected], with the following contents:

    subscribe oplstudio-list

    your e-mail address if different from the From fieldfirst name, last nameyour location (company and country)maintenance contract number

    maintenance contract owners last name

    Region E-mail Telephone Fax

    France [email protected] 0 800 09 27 91(numro vert)

    +33 (0)1 49 08 35 10

    Germany [email protected] +49 6172 40 60 - 0 +49 6172 40 60 -10

    Japan [email protected] +81 3 5211 5770 +81 3 5211 5771North America [email protected] 1-877-ILOG-TECH

    (toll free)+1 650 567 8001

    Singapore [email protected] +65 773 06 26 +65 773 04 39

    Spain [email protected] +34 91 710 2480 +34 91 372 9976

    United Kingdom [email protected] +44 (0)1344 661 630 +44 (0)1344 661 60110I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L

  • Web SiteThe technical support pages on our world wide web sites contain FAQ (Frequently Asked/Answered Questions) and the latest patches for some of our products. Changes are posted in the product mailing list. Access to these pages is restricted to owners of an on-going maintenance contract. The maintenance contract number and the name of the person this contract is sent to in your company will be needed for access, as explained on the login page.

    All three of these sites contain the same information, but access is localized, so we recommend that you connect to the site corresponding to your location, and select the Tech Support Web page from the home page.

    Americas: http://www.ilog.comAsia and Pacific Nations: http://www.ilog.com.sgEurope, Africa, and Middle East: http://www.ilog.frI L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L 11

  • 12I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L

  • Part I

  • The COM/ActiveX API

    This part of the manual documents the COM/ActiveX API, which provides access to the OPL solving engine.The OPL engine is available as a COM/ActiveX component on Windows platforms. This means that Windows users can solve an OPL model and examine the solution from Visual Basic, Visual Basic for Applications (VBA*), VBScript, JScript*, HTML, Delphi, or C++ applications.* VBA is the Microsoft Excel scripting language. JScript is the Microsoft implementation of of JavaScript.

    Each COM/ActiveX interface, class, or enumeration contains: a description of its function its synopsis in IDL (Interface Definition Language) separate language dependent synopses in Visual J++, Visual Basic and C++ a description of each of its member functions, where applicable.As the synopsis of each COM/ActiveX interface contains the method signatures for all three languages (IDL, Visual Basic, and C++), the Member Functions section gives the signatures for IDL methods only. Again, this is done for the sake of clarity and simplicity.

    Note: The.dll file implementing The OPL Component Library is loaded into the client process, and all the OPL objects will reside in the client's address space.I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L 15

  • 16I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L

  • COPLscriptSolverCOPLscriptSolver

    Category COM/ActiveX class

    Implementation IOPLscriptSolver, IClassFactory

    Description This COM class encapsulates the OPL engine and implements the IOPLscriptSolver interface. The way you instantiate a COPLscriptSolver, and obtain an IOPLscriptSolver interface reference to it, depends on the language you use.

    IDL Synopsis coclass COPLscriptSolver { [default] interface IOPLscriptSolver; interface IClassFactory; }

    Examples Visual BasicThe example in Visual basic below shows you how to instantiate the COPLscriptSolver COM class from a Visual Basic program.

    Dim solver As COPLscriptSolverSet solver = New COPLscriptSolver

    C++

    The example in C++ below shows you how to obtain a pointer to the IOPLsolver interface while instantiating the COPLscriptSolver COM class.

    #include #include #include .

    .

    IOPLsolver* itf = 0; HRESULT hr = CoInitializeEx(0); if (SUCCEEDED(hr)) { hr = CoCreateInstance(CLSID_COPLscriptSolver,0,CLSCTX_ALL, IID_IOPLsolver,(void **)&itf); if (SUCCEEDED(hr) && itf) { // Use of interface pointer itf .....

    itf->Release(); } CoUninitialize(); }.

    .I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L 17

  • COPLscriptSolverJScriptvar solver = new

    ActiveXObject("COPLscriptSolver.scriptSolverMeta.7");Visual Basic ScriptDim solver Set solver = CreateObject("COPLscriptSolver.scriptSolverMeta.7")

    HTML

    See Also IOPLscriptSolver 18 I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L

  • COPLsolverCOPLsolver

    Category COM/ActiveX class

    Implementation IOPLsolver, IClassFactory

    Description This COM class encapsulates the OPL engine and implements the IOPLsolver interface. The way you instantiate a COPLsolver object, and obtain an IOPLsolver interface reference to it, depends on the language you use. In Visual Basic you can obtain a reference to an IOPLsolver interface by allocating

    an object of the class COPLsolver. In C++, you can obtain a pointer to the IOPLsolver abstract class through the

    CoCreateInstance function, by specifying the COM interface identifier (IID) and the COM class identifier (CLSID).

    IDL Synopsis coclass COPLsolver { [default]interface IOPLsolver; interface IClassFactory;};

    Examples Visual BasicThe example in Visual basic below shows you how to instantiate the COPLsolver COM class from a Visual Basic program.Dim solver As COPLsolverSet solver = New COPLsolver

    C++The example in C++ below shows you how to obtain a pointer to the IOPLsolver interface while instantiating the COPLsolver COM class.#include #include #include ...

    IOPLsolver* itf = 0; HRESULT hr = CoInitializeEx(0); if (SUCCEEDED(hr)) { hr = CoCreateInstance(CLSID_COPLsolver,0,CLSCTX_ALL, IID_IOPLsolver,(void **)&itf); if (SUCCEEDED(hr) && itf) { // Use of interface pointer itf .....

    itf->Release(); } CoUninitialize(); }....I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L 19

  • COPLsolverJScriptvar solver = new ActiveXObject(COPLsolver.solverMeta.7);Visual Basic ScriptDim solver =CreateObject(COPLsolver.solverMeta.7);HTML

    See Also IOPLsolver20 I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L

  • I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L 21

    IOPLactivity

    IOPLactivity

    Category COM/ActiveX interface

    Inheritance Path IOPLdata

    Description IOPLactivity is an interface to objects of the type Activity defined in an OPL model.

    IDL Synopsis interface IOPLactivity : IOPLdata { HRESULT getDuration([out,retval] int* v); HRESULT getEnd([out,retval] int* v); HRESULT getStart([out,retval] int* v);};

    Visual Basic Synopsis Class IOPLactivity Function getDuration() As Long Function getEnd() As Long Function getStart() As Long

    C++ Synopsis class IOPLactivity:public IOPLdata{public: virtual STDMETHODIMP getDuration(int* v) = 0; virtual STDMETHODIMP getEnd(int* v) = 0; virtual STDMETHODIMP getStart(int* v) = 0;};

    Member Functions HRESULT getDuration([out,retval] int* v);

    This member function enables the client code to access the duration field of the OPL activity interfaced with the invoking object.

    HRESULT getEnd([out,retval] int* v);

    This member function enables the client code to access the end field of the OPL activity interfaced with the invoking object.

    HRESULT getStart([out,retval] int* v);

    This member function enables the client code to access the start field of the OPL activity interfaced with the invoking object.

  • IOPLarrayIOPLarray

    Category COM/ActiveX interface

    Inheritance Path IOPLdata

    Description IOPLarray provides an interface to array data structures defined in an OPL model.

    IDL Synopsis interface IOPLarray : IOPLdata { HRESULT eltActivity([in] int i,[out,retval] IOPLactivity** v); HRESULT eltArray([in] int i,[out,retval] IOPLarray** v); HRESULT eltChar([in] int i,[out,retval] IOPLchar** v); HRESULT eltConstraint([in] int i, [out,retval] IOPLconstraint** v); HRESULT eltEnumValue([in] int i,[out,retval] IOPLenumValue** v); HRESULT eltEnumVar([in] int i,[out,retval] IOPLenumVar** v); HRESULT eltFloat([in] int i,[out,retval] IOPLfloat** v); HRESULT eltFloatVar([in] int i,[out,retval] IOPLfloatVar** v); HRESULT eltInt([in] int i,[out,retval] IOPLint** v); HRESULT eltIntVar([in] int i,[out,retval] IOPLintVar** v); HRESULT eltSet([in] int i,[out,retval] IOPLset** v); HRESULT eltString([in] int i,[out,retval] IOPLstring** v); HRESULT eltStruct([in] int i,[out,retval] IOPLstruct** v); HRESULT getActivity([in] IOPLdata* i, HRESULT getArray([in] IOPLdata* i,[out,retval] IOPLarray** v); HRESULT getChar([in] IOPLdata* i,[out,retval] IOPLchar** v); HRESULT getClone([out,retval] IOPLarray** ret); HRESULT getConstraint([in] IOPLdata* i, [out,retval] IOPLconstraint** v); HRESULT getEnumValue([in] IOPLdata* i, [out,retval] IOPLenumValue** v); HRESULT getEnumVar([in] IOPLdata* i,[out,retval] IOPLenumVar** v); HRESULT getFloat([in] IOPLdata* i,[out,retval] IOPLfloat** v); HRESULT getFloatVar([in] IOPLdata* i, [out,retval] IOPLfloatVar** v); HRESULT getHigh([out,retval] int* ar); HRESULT getInt([in] IOPLdata* i,[out,retval] IOPLint** v); HRESULT getIntVar([in] IOPLdata* i,[out,retval] IOPLintVar** v); HRESULT getLow([out,retval] int* ar); HRESULT getSet([in] IOPLdata* i,[out,retval] IOPLset** v); HRESULT getSize([out,retval] int* ar); HRESULT getString([in] IOPLdata* i,[out,retval] IOPLstring** v); HRESULT getStruct([in] IOPLdata* i,[out,retval] IOPLstruct** v);};22 I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L

  • IOPLarrayVisual Basic Synopsis Class IOPLarray Function eltActivity(i As Long) As IOPLactivity Function eltArray(i As Long) As IOPLarray Function eltChar(i As Long) As IOPLchar Function eltConstraint(i As Long) As IOPLconstraint Function eltEnumValue(i As Long) As IOPLenumValue Function eltEnumVar(i As Long) As IOPLenumVar Function eltFloat(i As Long) As IOPLfloat Function eltFloatVar(i As Long) As IOPLfloatVar Function eltInt(i As Long) As IOPLint Function eltIntVar(i As Long) As IOPLintVar Function eltSet(i As Long) As IOPLset Function eltString(i As Long) As IOPLstring Function eltStruct(i As Long) As IOPLstruct Function getActivity(i As IOPLdata) As IOPLactivity Function getArray(i As IOPLdata) As IOPLarray Function getChar(i As IOPLdata) As IOPLchar Function getClone() As IOPLarray Function getConstraint(i As IOPLdata) As IOPLconstraint Function getEnumValue(i As IOPLdata) As IOPLenumValue Function getEnumVar(i As IOPLdata) As IOPLenumVar Function getFloat(i As IOPLdata) As IOPLfloat Function getFloatVar(i As IOPLdata) As IOPLfloatVar Function getHigh() As Long Function getInt(i As IOPLdata) As IOPLint Function getIntVar(i As IOPLdata) As IOPLintVar Function getLow() As Long Function getSet(i As IOPLdata) As IOPLset Function getSize() As Long Function getString(i As IOPLdata) As IOPLstring Function getStruct(i As IOPLdata) As IOPLstruct

    C++ Synopsis class IOPLarray : public IOPLdata{public: virtual STDMETHODCALLTYPE eltActivity(int i, IOPLactivity * *v) = 0; virtual STDMETHODCALLTYPE eltArray(int i, IOPLarray * *v) = 0; virtual STDMETHODCALLTYPE eltChar(int i, IOPLchar * *v) = 0; virtual STDMETHODCALLTYPE eltConstraint (int i, IOPLconstraint * *v) = 0; virtual STDMETHODCALLTYPE eltEnumValue (int i, IOPLenumValue * *v) = 0; virtual STDMETHODCALLTYPE eltEnumVar(int i, IOPLenumVar * *v) = 0; virtual STDMETHODCALLTYPE eltFloat(int i, IOPLfloat * *v) = 0; virtual STDMETHODCALLTYPE eltFloatVar(int i, IOPLfloatVar * *v) = 0; virtual STDMETHODCALLTYPE eltInt(int i, IOPLint * *v) = 0; virtual STDMETHODCALLTYPE eltIntVar(int i, IOPLintVar * *v) = 0;I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L 23

  • IOPLarray virtual STDMETHODCALLTYPE eltSet(int i, IOPLset * *v) = 0; virtual STDMETHODCALLTYPE eltString(int i, IOPLstring * *v) = 0; virtual STDMETHODCALLTYPE eltStruct(int i, IOPLstruct * *v) = 0; virtual STDMETHODCALLTYPE getActivity(IOPLdata *i, IOPLactivity * *v) = 0; virtual STDMETHODCALLTYPE getArray (IOPLdata *i, IOPLarray * *v) = 0; virtual STDMETHODCALLTYPE getChar (IOPLdata *i, IOPLchar * *v) = 0; virtual STDMETHODCALLTYPE getClone(IOPLarray * *ret) = 0; virtual STDMETHODCALLTYPE getConstraint (IOPLdata *i, IOPLconstraint * *v) = 0; virtual STDMETHODCALLTYPE getEnumValue (IOPLdata *i, IOPLenumValue * *v) = 0; virtual STDMETHODCALLTYPE getEnumVar (IOPLdata *i, IOPLenumVar * *v) = 0; virtual STDMETHODCALLTYPE getFloat (IOPLdata *i, IOPLfloat * *v) = 0; virtual STDMETHODCALLTYPE getFloatVar (IOPLdata *i, IOPLfloatVar * *v) = 0; virtual STDMETHODCALLTYPE getHigh(int *ar) = 0; virtual STDMETHODCALLTYPE getInt(IOPLdata *i, IOPLint * *v) = 0; virtual STDMETHODCALLTYPE getIntVar (IOPLdata *i, IOPLintVar * *v) = 0; virtual STDMETHODCALLTYPE getLow(int *ar) = 0; virtual STDMETHODCALLTYPE getSet(IOPLdata *i, IOPLset * *v) = 0; virtual STDMETHODCALLTYPE getSize(int *ar) = 0; virtual STDMETHODCALLTYPE getString (IOPLdata *i, IOPLstring * *v) = 0; virtual STDMETHODCALLTYPE getStruct (IOPLdata *i, IOPLstruct * *v) = 0;};

    Member Functions HRESULT eltActivity([in] int i,[out,retval] IOPLactivity** v);

    This member function enables the client code to access an element in the OPL array interfaced by the invoking object. It assumes that the array in the OPL model is declared as an array of activities indexed by an integer range. The integer argument i is the index of the element being accessed. When successfully called from Visual Basic, this member function returns an interface object of the class IOPLactivity. When successfully called from C++, this member function will fill the memory pointed to by the pointer argument v with a pointer to an interface object of the class IOPLactivity.

    HRESULT eltArray([in] int i,[out,retval] IOPLarray** v);

    This member function enables the client code to access an element in the OPL array interfaced by the invoking object. It assumes that the array in the OPL model is declared as an array of arrays indexed by an integer range. The integer argument i is the index of the element being accessed. When successfully called from Visual Basic, this member 24 I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L

  • IOPLarrayfunction returns an interface object of the class IOPLarray. When successfully called from C++, this member function will fill the memory pointed to by the pointer argument v with a pointer to an interface object of the class IOPLarray.

    HRESULT eltChar([in] int i,[out,retval] IOPLchar** v);Returns the vth element of the array and interprets it as a char (if possible, otherwise it raises a runtime error).

    HRESULT eltConstraint([in] int i,[out,retval] IOPLconstraint** v);

    This member function enables the client code to access an element in the OPL array interfaced by the invoking object. It assumes that the array in the OPL model is declared as an array of constraints, indexed by an integer range. The integer argument i is the index of the element being accessed. When successfully called from Visual Basic, this member function returns an interface object of the class IOPLconstraint. When successfully called from C++, this member function will fill the memory pointed to by the pointer argument v with a pointer to an interface object of the class IOPLconstraint.

    HRESULT eltEnumValue([in] int i,[out,retval] IOPLenumValue** v);

    This member function enables the client code to access an element in the OPL array interfaced by the invoking object. It assumes that the array in the OPL model is declared as an array of enumerated values, indexed by an integer range. The integer argument i is the index of the element being accessed. When successfully called from Visual Basic, this member function returns an interface object of the class IOPLenumValue. When successfully called from C++, this member function will fill the memory pointed to by the pointer argument v with a pointer to an interface object of the class IOPLenumValue.

    HRESULT eltEnumVar([in] int i,[out,retval] IOPLenumVar** v);

    This member function enables the client code to access an element in the OPL array interfaced by the invoking object. It assumes that the array in the OPL model is declared as an array of enumerated variables indexed by an integer range. The integer argument i is the index of the element being accessed. When successfully called from Visual Basic, this member function returns an interface object of the class IOPLenumVar. When successfully called from C++, this member function will fill the memory pointed to by the pointer argument v with a pointer to an interface object of the class IOPLenumVar.

    HRESULT eltFloat([in] int i,[out,retval] IOPLfloat** v);

    This member function enables the client code to access an element in the OPL array interfaced by the invoking object. It assumes that the array in the OPL model is declared as an array of floats, indexed by an integer range. The integer argument i is the index of the element being accessed. When successfully called from Visual Basic, this member I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L 25

  • IOPLarrayfunction returns an interface object of the class IOPLfloat. When successfully called from C++, this member function will fill the memory pointed to by the pointer argument v with a pointer to an interface object of the class IOPLfloat.

    HRESULT eltFloatVar([in] int i,[out,retval] IOPLfloatVar** v);

    This member function enables the client code to access an element in the OPL array interfaced by the invoking object. It assumes that the array in the OPL model is declared as an array of float variables indexed by an integer range. The integer argument i is the index of the element being accessed. When successfully called from Visual Basic, this member function returns an interface object of the class IOPLfloatVar. When successfully called from C++, this member function will fill the memory pointed to by the pointer argument v with a pointer to an interface object of the class IOPLfloatVar.

    HRESULT eltInt([in] int i,[out,retval] IOPLint** v);

    This member function enables the client code to access an element in the OPL array interfaced by the invoking object. It assumes that the array in the OPL model is declared as an array of integers, indexed by an integer range. The integer argument i is the index of the element being accessed. When successfully called from Visual Basic, this member function returns an interface object of the class IOPLint. When successfully called from C++, this member function will fill the memory pointed to by the pointer argument v with a pointer to an interface object of the class IOPLint.

    HRESULT eltIntVar([in] int i,[out,retval] IOPLintVar** v);

    This member function enables the client code to access an element in the OPL array interfaced by the invoking object. It assumes that the array in the OPL model is declared as an array of integer variables indexed by an integer range. The integer argument i is the index of the element being accessed. When successfully called from Visual Basic, this member function returns an interface object of the class IOPLintVar. When successfully called from C++, this member function will fill the memory pointed to by the pointer argument v with a pointer to an interface object of the class IOPLintVar.

    HRESULT eltSet([in] int i,[out,retval] IOPLset** v);

    This member function enables the client code to access an element in the OPL array interfaced by the invoking object. It assumes that the array in the OPL model is declared as an array of sets, indexed by an integer range. The integer argument i is the index of the element being accessed. When successfully called from Visual Basic, this member function returns an interface object of the class IOPLset. When successfully called from C++, this member function will fill the memory pointed to by the pointer argument v with a pointer to an interface object of the class IOPLset.

    HRESULT eltString([in] int i,[out,retval] IOPLstring** v);

    This member function enables the client code to access an element in the OPL array interfaced by the invoking object. It assumes that the array in the OPL model is declared as an array of strings, indexed by an integer range. The integer argument i is the index of 26 I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L

  • IOPLarraythe element being accessed. When successfully called from Visual Basic, this member function returns an interface object of the class IOPLstring. When successfully called from C++, this member function will fill the memory pointed to by the pointer argument v with a pointer to an interface object of the class IOPLstring.

    HRESULT eltStruct([in] int i,[out,retval] IOPLstruct** v);

    This member function enables the client code to access an element in the OPL array interfaced by the invoking object. It assumes that the array in the OPL model is declared as an array of records, indexed by an integer range. The integer argument i is the index of the element being accessed. When successfully called from Visual Basic, this member function returns an interface object of the class IOPLstruct. When successfully called from C++, this member function will fill the memory pointed to by the pointer argument v with a pointer to an interface object of the class IOPLstruct.

    HRESULT getActivity([in] IOPLdata* i,[out,retval] IOPLactivity** v);

    This member function enables the client code to access an element in the OPL array interfaced by the invoking object. It assumes that the array in the OPL model is declared as an array of activities. The input argument i is the index of the element being accessed. The index must be an object of the class IOPLdata. When successfully called from Visual Basic, this member function returns an interface object of the class IOPLactivity. When successfully called from C++, this member function will fill the memory pointed to by the pointer argument v with a pointer to an interface object of class IOPLactivity.

    HRESULT getArray([in] IOPLdata* i,[out,retval] IOPLarray** v);

    This member function enables the client code to access an element in the OPL array interfaced by the invoking object. It assumes that the array in the OPL model is declared as an array of arrays. The input argument i is the index of the element being accessed. The index must be an object of the class IOPLdata. When successfully called from Visual Basic, this member function returns an interface object of the class IOPLarray. When successfully called from C++, this member function will fill the memory pointed to by the pointer argument v with a pointer to an interface object of the class IOPLarray.

    HRESULT getChar([in] IOPLdata* i,[out,retval] IOPLchar** v);

    Returns the vth element of the array and interprets it as a char (if possible, otherwise it raises a runtime error).

    HRESULT getClone([out,retval] IOPLarray** ret);

    This member function enables the client code to construct a new interface object of the same class as the invoking object. The new object interfaces to the same OPL data item as the invoking object.I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L 27

  • IOPLarrayHRESULT getConstraint([in] IOPLdata* i, [out,retval] IOPLconstraint** v);

    This member function enables the client code to access an element in the OPL array interfaced by the invoking object. It assumes the array in the OPL model being declared as an array of constraints. The input argument 'i' is the index of the element being accessed. The index must be an object of class IOPLdata. When successfully called from Visual Basic, this member function returns an interface object of the class IOPLconstraint. When successfully called from C++, this member function will fill the memory pointed to by the pointer argument v with a pointer to an interface object of the class IOPLconstraint.

    HRESULT getEnumValue([in] IOPLdata* i,[out,retval] IOPLenumValue** v);

    This member function enables the client code to access an element in the OPL array interfaced by the invoking object. It assumes that the array in the OPL model is declared as an array of enumerated values. The input argument i is the index of the element being accessed. The index must be an object of the class IOPLdata. When successfully called from Visual Basic, this member function returns an interface object of the class IOPLenumValue. When successfully called from C++, this member function will fill the memory pointed to by the pointer argument v with a pointer to an interface object of the class IOPLenumValue.

    HRESULT getEnumVar([in] IOPLdata* i,[out,retval] IOPLenumVar** v);

    This member function enables the client code to access an element in the OPL array interfaced by the invoking object. It assumes that the array in the OPL model is declared as an array of enumerated variables. The input argument i is the index of the element being accessed. The index must be an object of the class IOPLdata. When successfully called from Visual Basic, this member function returns an interface object of the class IOPLenumVar. When successfully called from C++, this member function will fill the memory pointed to by the pointer argument v with a pointer to an interface object of the class IOPLenumVar.

    HRESULT getFloat([in] IOPLdata* i,[out,retval] IOPLfloat** v);

    This member function enables the client code to access an element in the OPL array interfaced by the invoking object. It assumes that the array in the OPL model is declared as an array of floats. The input argument i is the index of the element being accessed. The index must be an object of the class IOPLdata. When successfully called from Visual Basic, this member function returns an interface object of the class IOPLfloat. When successfully called from C++, this member function will fill the memory pointed to by the pointer argument v with a pointer to an interface object of the class IOPLfloat.

    HRESULT getFloatVar([in] IOPLdata* i,[out,retval] IOPLfloatVar** v);

    This member function enables the client code to access an element in the OPL array interfaced by the invoking object. It assumes that the array in the OPL model is declared as an array of float variables. The input argument i is the index of the element being 28 I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L

  • IOPLarrayaccessed. The index must be an object of the class IOPLdata. When successfully called from Visual Basic, this member function returns an interface object of the class IOPLfloatVar. When successfully called from C++, this member function will fill the memory pointed to by the pointer argument v with a pointer to an interface object of the class IOPLfloatVar.

    HRESULT getHigh([out,retval] int* ar);

    This member function enables the client code to retrieve the highest value allowed to index the OPL array interfaced by the invoking object. It assumes that the OPL array is indexed by an integer range.

    HRESULT getInt([in] IOPLdata* i,[out,retval] IOPLint** v);

    This member function enables the client code to access an element in the OPL array interfaced by the invoking object. It assumes that the array in the OPL model is declared as an array of integers. The input argument i is the index of the element being accessed. The index must be an object of class IOPLdata. When successfully called from Visual Basic, this member function returns an interface object of the class IOPLint. When successfully called from C++, this member function will fill the memory pointed to by the pointer argument v with a pointer to an interface object of the class IOPLint.

    HRESULT getIntVar([in] IOPLdata* i,[out,retval] IOPLintVar** v);

    This member function enables the client code to access an element in the OPL array interfaced by the invoking object. It assumes that the array in the OPL model is declared as an array of integer variables. The input argument i is the index of the element being accessed. The index must be an object of the class IOPLdata. When successfully called from Visual Basic, this member function returns an interface object of the class IOPLintVar. When successfully called from C++, this member function will fill the memory pointed to by the pointer argument v with a pointer to an interface object of the class IOPLintVar.

    HRESULT getLow([out,retval] int* ar);

    This member function enables the client code to retrieve the lowest value allowed to index the OPL array interfaced by the invoking object. It assumes that the OPL array is indexed by an integer range.

    HRESULT getSet([in] IOPLdata* i,[out,retval] IOPLset** v);

    This member function enables the client code to access an element in the OPL array interfaced by the invoking object. It assumes that the array in the OPL model is declared as an array of sets. The input argument i is the index of the element being accessed. The index must be an object of the class IOPLdata. When successfully called from Visual Basic, this member function returns an interface object of the class IOPLset. When successfully called from C++, this member function will fill the memory pointed to by the pointer argument v with a pointer to an interface object of the class IOPLset.I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L 29

  • IOPLarrayHRESULT getSize([out,retval] int* ar);

    This member function enables the client code to retrieve the size, as a number of elements, of the OPL array interfaced by the invoking object.

    HRESULT getString([in] IOPLdata* i,[out,retval] IOPLstring** v);

    This member function enables the client code to access an element in the OPL array interfaced by the invoking object. It assumes that the array in the OPL model is declared as an array of strings. The input argument i is the index of the element being accessed. The index must be an object of the class IOPLdata.When successfully called from Visual Basic, this member function returns an interface object of the class IOPLstring. When successfully called from C++, this member function will fill the memory pointed to by the pointer argument v with a pointer to an interface object of the class IOPLstring.

    HRESULT getStruct([in] IOPLdata* i,[out,retval] IOPLstruct** v);

    This member function enables the client code to access an element in the OPL array interfaced by the invoking object. It assumes that the array in the OPL model is declared as an array of records. The input argument i is the index of the element being accessed. The index must be an object of the class IOPLdata. When successfully called from Visual Basic, this member function returns an interface object of the class IOPLstruct. When successfully called from C++, this member function will fill the memory pointed to by the pointer argument v with a pointer to an interface object of the class IOPLstruct.30 I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L

  • I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L 31

    IOPLbasisStatus

    IOPLbasisStatus

    Category COM enumeration

    Description This enumeration provides identifiers that describe the possible basis statuses for any float variable or linear constraint occurring in a linear OPL model.

    Use the member functions:

    IOPLfloatVar::getBasisStatus,

    IOPLconstraint::getBasisStatus

    in order to obtain the basis status for a float variable or a linear constraint respectively.

    The identifiers listed below, when associated with a variable, have the following meanings:

    IOPLnoBasis: no basis information was defined for the variable

    IOPLatLower: the variable is at lower bound

    IOPLinBasis: the variable is basic

    IOPLatUpper: the variable is at upper bound

    IOPLfreeSuper: the variable is free and non-basic.

    The identifiers listed below, when associated with a constraint, have the following meanings:

    IOPLnoBasis: no basis information was defined for the constraint

    IOPLatLower: associated slack/surplus/artificial variable non-basic at value 0.0

    IOPLinBasis: associated slack/surplus/artificial variable basic.

    IDL Synopsis enum IOPLbasisStatus {IOPLnoBasis = 0, IOPLatLower, IOPLinBasis, IOPLatUpper, IOPLfreeSuper};

    C++ Synopsis enum IOPLbasisStatus {IOPLnoBasis = 0, IOPLatLower = IOPLnoBasis + 1, IOPLinBasis = IOPLatLower + 1, IOPLatUpper = IOPLinBasis + 1, IOPLfreeSuper = IOPLatUpper + 1};

    See Also IOPLfloatVar::getBasisStatus, IOPLconstraint::getBasisStatus

  • 32 I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L

    IOPLchar

    IOPLchar

    Category COM/ActiveX interface

    Inheritance Path IOPLdata

    Description The class IOPLchar provides an interface to character types defined in an OPL model.

    IDL Synopsis interface IOPLchar : IOPLdata { HRESULT getClone([out,retval] IOPLchar** ret); HRESULT getValue([out,retval] wchar_t* v); HRESULT setValue([in] wchar_t v);};

    Visual Basic Synopsis Class IOPLchar Function getClone() As IOPLchar Function getValue() As char Sub setValue(v As char)

    C++ Synopsis class IOPLchar : public IOPLdata{public: virtual STDMETHODIMP getClone(IOPLchar** ret) = 0; virtual STDMETHODIMP getValue(wchar_t* v) = 0; virtual STDMETHODIMP setValue(wchar_t v) = 0;};

    Member Functions HRESULT getClone([out,retval] IOPLchar** ret);

    Creates a clone of the char object. Enables the client code to construct a new object of the same class as the invoking object. The new object interfaces with the same OPL data item as the invoking object.

    HRESULT getValue([out,retval] wchar_t* v);

    Returns the character stored in the object.HRESULT setValue([in] wchar_t v);

    Changes the character stored in the object to ch.

  • IOPLconstraintIOPLconstraint

    Category COM/ActiveX interface

    Inheritance Path IOPLdata

    Description The class IOPLconstraint provides an interface to the constraints defined in an OPL model.

    IDL Synopsis interface IOPLconstraint : IOPLdata { HRESULT getBasisStatus([out,retval] enum IOPLbasisStatus* ret); HRESULT getBasisStatus([out,retval] double* ret); HRESULT getBasisStatus([out,retval] IOPLconstraint** ret); HRESULT getLhs([out,retval] double* ret); HRESULT getRhs([out,retval] double* ret); HRESULT getRight([out,retval] IOPLconstraint** ret); HRESULT getSlack([out,retval] double* ret);};

    Visual J++ Synopsis public interface IOPLconstraint extends oplserver.IOPLdata{ public int getBasisStatus(); public double getDual(); public IOPLconstraint getLeft(); public double getLhs(); public double getBasisStatus(); public IOPLconstraint getRight(); public double getSlack();}I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L 33

  • IOPLconstraintC++ Synopsis class IOPLconstraint : public IOPLdata{public: virtual STDMETHODIMP getBasisStatus(enum IOPLbasisStatus *ret) = 0; virtual STDMETHODIMP getDual(double *ret) = 0; virtual STDMETHODIMP getLeft(IOPLconstraint * *ret) = 0; virtual STDMETHODIMP getLhs(double *ret) = 0; virtual STDMETHODIMP getRhs(double *ret) = 0; virtual STDMETHODIMP getRight(IOPLconstraint * *ret) = 0; virtual STDMETHODIMP getSlack(double *ret) = 0;};

    Member Functions HRESULT getBasisStatus([out,retval] enum IOPLbasisStatus* ret);

    This member function enables the client code to retrieve the basis status associated, in a linear OPL model, with the linear constraint interfaced by the invoking object.

    HRESULT getDual([out,retval] double* ret);

    This member function enables the client code to get the dual value associated, in a linear OPL model, with the linear constraint interfaced by the invoking object.

    HRESULT getLeft([out,retval] IOPLconstraint** ret);

    This member function enables the client code to retrieve an individual constraint component of the constraint interfaced by the invoking object. It assumes that the invoking object interfaces a constraint of the form l

  • I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L 35

    IOPLdata

    IOPLdata

    Category Abstract COM/ActiveX interface

    Inheritance Path IDispatch

    Description This interface is the base interface for the other IOPL* COM/ActiveX interfaces that refer to the data items of an OPL model.

    IDL Synopsis interface IOPLdata : IDispatch { HRESULT getImpl([out,retval] IUnknown** impl);}

    Visual Basic Synopsis Class IOPLdata Function getImpl() As IUnknown

    C++ Synopsis class IOPLdata : public IDispatch{public: virtual STDMETHODIMP getImpl( /* [retval][out] */ IUnknown * *impl) = 0;};

    Member Function HRESULT getImpl([out,retval] IUnknown** impl);

    This member function provides a reference to the object internally used by the OPL engine in order to implement the invoking object.

  • IOPLenumIOPLenum

    Category COM/ActiveX interface

    Inheritance Path IOPLdata

    Description The class IOPLenum provides an interface to enumeration types defined in an OPL model.

    IDL Synopsis interface IOPLenum : IOPLdata { HRESULT getCard([out,retval] int* c); HRESULT getFirst([out,retval] IOPLenumValue** ppEv); HRESULT getIterator([out,retval] IOPLenumIterator** ppIt); HRESULT getLast([out,retval] IOPLenumValue** ppEv); HRESULT getNext([in] IOPLenumValue* ev, [out,retval] IOPLenumValue** ppEv); HRESULT getNextc([in] IOPLenumValue* ev, HRESULT getOrd([in] IOPLenumValue* pEv, [out,retval] int* ordinal); HRESULT getPrev([in] IOPLenumValue* ev, [out,retval] IOPLenumValue** ppEv); HRESULT getPrevc([in] IOPLenumValue* ev, [out,retval] IOPLenumValue** ppEv); HRESULT getValue([in] BSTR valName, [out,retval] IOPLenumValue** ppEv);};

    Visual Basic Synopsis Class IOPLenum Function getCard() As Long Function getFirst() As IOPLenumValue Function getIterator() As IOPLenumIterator Function getLast() As IOPLenumValue Function getNext(ev As IOPLenumValue) As IOPLenumValue Function getNextc(ev As IOPLenumValue) As IOPLenumValue Function getOrd(pEv As IOPLenumValue) As Long Function getPrev(ev As IOPLenumValue) As IOPLenumValue Function getPrevc(ev As IOPLenumValue) As IOPLenumValue Function getValue(valName As String) As IOPLenumValue36 I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L

  • IOPLenumC++ Synopsis class IOPLenum : public IOPLdata{public: virtual STDMETHODIMP getCard(int *c) = 0; virtual STDMETHODIMP getFirst(IOPLenumValue * *ppEv) = 0; virtual STDMETHODIMP getIterator (IOPLenumIterator * *ppIt) = 0; virtual STDMETHODIMP getLast(IOPLenumValue * *ppEv) = 0; virtual STDMETHODIMP getNext(IOPLenumValue *ev, IOPLenumValue * *ppEv) = 0; virtual STDMETHODIMP getNextc(IOPLenumValue *ev, IOPLenumValue * *ppEv) = 0; virtual STDMETHODIMP getPrev(IOPLenumValue *ev, IOPLenumValue * *ppEv) = 0; virtual STDMETHODIMP getPrevc(IOPLenumValue *ev, IOPLenumValue * *ppEv) = 0; virtual STDMETHODIMP getValue(BSTR valName, IOPLenumValue * *ppEv) = 0;};

    Member Functions HRESULT getCard([out,retval] int* c);

    This member function enables the client code to obtain the cardinality (i.e. the number of values) of the OPL enumeration interfaced by the invoking object.

    HRESULT getFirst([out,retval] IOPLenumValue** ppEv);

    This member function enables the client code to access the first enumerated value of the OPL enumeration interfaced by the invoking object. When successfully called from Visual Basic, this member function returns an interface object of the class IOPLenumValue. When successfully called from C++, this member function will fill the memory pointed to by the pointer argument ppEv with a pointer to an interface object of the class IOPLenumValue.

    HRESULT getIterator([out,retval] IOPLenumIterator** ppIt);

    This member function constructs a new iterator object, instance of the class IOPLenumIterator. Further, this iterator object will enable the client code to obtain the enumerated values of the OPL enumeration interfaced by the invoking object.

    HRESULT getLast([out,retval] IOPLenumValue** ppEv);

    This member function enables the client code to access the last enumerated value of the OPL enumeration interfaced by the invoking object. When successfully called from Visual Basic, this member function returns an interface object of the class IOPLenumValue. When successfully called from C++, this member function will fill the memory pointed to by the pointer argument ppEv with a pointer to an interface object of the class IOPLenumValue.I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L 37

  • IOPLenumHRESULT getNext([in] IOPLenumValue* ev, [out,retval] IOPLenumValue** ppEv);

    This member function enables the client code to access the enumerated value which follows, in the OPL enumeration interfaced by the invoking object, the value interfaced by the input argument ev. When successfully called from Visual Basic, this member function returns an interface object of the class IOPLenumValue. When successfully called from C++, this member function will fill the memory pointed to by the pointer argument ppEv with a pointer to an interface object of the class IOPLenumValue.

    HRESULT getNextc([in] IOPLenumValue* ev,

    This member function enables the client code to access the enumerated value which follows, in the OPL enumeration interfaced by the invoking object, the value interfaced by the input argument ev. The OPL enumeration is considered as circular, i.e. the last value is followed by the first value and the first value is preceded by the last value. When successfully called from Visual Basic, this member function returns an interface object of the class IOPLenumValue. When successfully called from C++, this member function will fill the memory pointed to by the pointer argument ppEv with a pointer to an interface object of the class IOPLenumValue.

    HRESULT getOrd([in] IOPLenumValue* pEv,[out,retval] int* ordinal);

    This member function enables the client code to retrieve the ordinal of the enumerated value interfaced by the argument pEV, in the OPL enumeration interfaced by the invoking object.

    HRESULT getPrev([in] IOPLenumValue* ev, [out,retval] IOPLenumValue** ppEv);

    This member function enables the client code to access the enumerated value which precedes, in the OPL enumeration interfaced by the invoking object, the value interfaced by the input argument ev. When successfully called from Visual Basic, this member function returns an interface object of the class IOPLenumValue. When successfully called from C++, this member function will fill the memory pointed to by the pointer argument ppEv with a pointer to an interface object of the class IOPLenumValue.

    HRESULT getPrevc([in] IOPLenumValue* ev, [out,retval] IOPLenumValue** ppEv);

    This member function enables the client code to access the enumerated value which precedes, in the OPL enumeration interfaced by the invoking object, the value interfaced by the input argument ev. The OPL enumeration is considered as circular, i.e. the last value is followed by the first value and the first value is preceded by the last value. When successfully called from Visual Basic, this member function returns an interface object of the class IOPLenumValue. When successfully called from C++, this member function will fill the memory pointed to by the pointer argument ppEv with a pointer to an interface object of the class IOPLenumValue.38 I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L

  • IOPLenumHRESULT getValue([in] BSTR valName, [out,retval] IOPLenumValue** ppEv);

    This member function enables the client code to access the enumerated value with the name valName in the OPL enumeration interfaced by the invoking object. When successfully called from Visual Basic, this member function returns an interface object of class IOPLenumValue. When successfully called from C++, this member function will fill the memory pointed to by the pointer argument ppEv with a pointer to an interface object of the class IOPLenumValue.

    See Also IOPLenumIteratorI L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L 39

  • IOPLenumIteratorIOPLenumIterator

    Category COM/ActiveX interface

    Inheritance Path IDispatch

    Description The class IOPLenumIterator provides a way to find out the enumerated values of an enumerated type defined in an OPL model. An instance of the class IOPLenumIterator (an iterator object) can be constructed by calling the member function IOPLenum::getIterator, where the invoking object, of the class IOPLenum, interfaces the OPL enumeration to be iterated. Upon successful construction, the iterator object initially points to the first value of the iterated OPL enumeration.

    IDL Synopsis interface IOPLenumIterator : IUnknown { HRESULT get([out,retval] IOPLenumValue** ppEv); HRESULT next(); HRESULT ok([out,retval] int* doneFlag); HRESULT reset();};

    C++ Synopsis class IOPLenumIterator : public IUnknown{public: virtual STDMETHODIMP get(IOPLenumValue * *ppEv) = 0; virtual STDMETHODIMP next(void) = 0; virtual STDMETHODIMP ok(int *doneFlag) = 0; virtual STDMETHODIMP reset(void) = 0;};40 I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L

  • IOPLenumIteratorMember Functions HRESULT get([out,retval] IOPLenumValue** ppEv);

    This member function can be used in order to access the enumerated value currently pointed to by the invoking iterator. Prior to invoking this member function, use the member function ok in order to ensure that the invoking object does not point "past the end" of the iterated OPL enumeration. When successfully called from Visual Basic, this member function returns an interface object of the class IOPLenumValue. When successfully called from C++, this member function will fill the memory pointed to by the pointer argument ppEv with a pointer to an interface object of the class IOPLenumValue.

    HRESULT next();

    This member function enables the invoking object to point to the next enumerated value of the iterated OPL enumeration.

    HRESULT ok([out,retval] int* doneFlag);

    This member function can be used in order to test whether the invoking object is pointing "past the end" of the iterated OPL enumeration. If the returned value is non-zero, then the member function IOPLenumIterator::get can be used further in order to access the enumerated value currently pointed to by the invoking object.

    HRESULT reset();

    This member function re-initializes the invoking object such that it can be reused to iterate over the same OPL enumeration, starting from its first value.

    See Also IOPLenumI L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L 41

  • IOPLenumValueIOPLenumValue

    Category COM/ActiveX interface

    Inheritance Path IOPLdata

    Description The class IOPLenumValue provides an interface to values of enumerated types defined in an OPL model.

    IDL Synopsis interface IOPLenumValue : IOPLdata { HRESULT getClone([out,retval] IOPLenumValue** ret); HRESULT getClone([out,retval] BSTR* str); HRESULT getClone([out,retval] int* v); HRESULT getClone([in] IOPLenumValue* e,[out,retval] int* b); HRESULT isGreaterOrEqualTo([in] IOPLenumValue* e, [out,retval] int* b); HRESULT isGreaterThan([in] IOPLenumValue* e, [out,retval] int* b); HRESULT isNotEqualTo([in] IOPLenumValue* e, [out,retval] int* b); HRESULT isSmallerOrEqualTo([in] IOPLenumValue* e, [out,retval] int* b); HRESULT isSmallerThan([in] IOPLenumValue* e, [out,retval] int* b); HRESULT setValue([in] IOPLenumValue* v);};

    Visual Basic Synopsis Class IOPLenumValue Function getClone() As IOPLenumValue Function getName() As String Function getValue() As Long Function isEqualTo(e As IOPLenumValue) As Long Function isGreaterOrEqualTo(e As IOPLenumValue) As Long Function isGreaterThan(e As IOPLenumValue) As Long Function isNotEqualTo(e As IOPLenumValue) As Long Function isSmallerOrEqualTo(e As IOPLenumValue) As Long Function isSmallerThan(e As IOPLenumValue) As Long Sub setValue(v As IOPLenumValue)42 I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L

  • IOPLenumValueC++ Synopsis class IOPLenumValue : public IOPLdata{public: virtual STDMETHODIMP getClone(IOPLenumValue * *ret) = 0; virtual STDMETHODIMP getName(BSTR *str) = 0; virtual STDMETHODIMP getValue(int *v) = 0; virtual STDMETHODIMP isEqualTo(IOPLenumValue *e, int *b) = 0; virtual STDMETHODIMP isGreaterOrEqualTo (IOPLenumValue *e, int *b) = 0; virtual STDMETHODIMP isGreaterThan (IOPLenumValue *e, int *b) = 0; virtual STDMETHODIMP isNotEqualTo (IOPLenumValue *e, int *b) = 0; virtual STDMETHODIMP isSmallerOrEqualTo (IOPLenumValue *e, int *b) = 0; virtual STDMETHODIMP isSmallerThan (IOPLenumValue *e, int *b) = 0; virtual STDMETHODIMP setValue(IOPLenumValue *v) = 0;};

    Member Functions HRESULT getClone([out,retval] IOPLenumValue** ret);

    This member function enables the client code to construct a new interface object of the same class as the invoking object. The new object interfaces to the same OPL data item as the invoking object.

    HRESULT getName([out,retval] BSTR* str);

    This member function enables the client code to retrieve the name of the OPL enumerated value interfaced by the invoking object.

    HRESULT getValue([out,retval] int* v);

    This member function enables the client code to retrieve the integer value corresponding to the OPL enumerated value interfaced by the invoking object.

    HRESULT isEqualTo([in] IOPLenumValue* e,[out,retval] int* b);

    This member function returns a non-zero value if the OPL enumerated value interfaced by the invoking object is equal to the OPL enumerated value interfaced by the input argument e.

    HRESULT isGreaterOrEqualTo([in] IOPLenumValue* e, [out,retval] int* b);

    This member function returns a non-zero value if the OPL enumerated value interfaced by the invoking object is greater or equal to the OPL enumerated value interfaced by the input argument e.I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L 43

  • IOPLenumValueHRESULT isGreaterThan([in] IOPLenumValue* e,[out,retval] int* b);

    This member function returns a non-zero value if the OPL enumerated value interfaced by the invoking object is greater than the OPL enumerated value interfaced by the input argument e.

    HRESULT isNotEqualTo([in] IOPLenumValue* e,[out,retval] int* b);

    This member function returns a non-zero value if the OPL enumerated value interfaced by the invoking object is not equal to the OPL enumerated value interfaced by the input argument e.

    HRESULT isSmallerOrEqualTo([in] IOPLenumValue* e, [out,retval] int* b);

    This member function returns a non-zero value if the OPL enumerated value interfaced by the invoking object is smaller or equal to the OPL enumerated value interfaced by the input argument e.

    HRESULT isSmallerThan([in] IOPLenumValue* e,[out,retval] int* b);

    This member function returns a non-zero value if the OPL enumerated value interfaced by the invoking object is smaller than the OPL enumerated value interfaced by the input argument e.

    HRESULT setValue([in] IOPLenumValue* v);

    This member function enables the client code to modify the invoking object. Upon a successful call, the invoking object interfaces the same OPL enumerated value as the input argument v.44 I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L

  • I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L 45

    IOPLenumVar

    IOPLenumVar

    Category COM/ActiveX interface

    Inheritance Path IOPLdata

    Description The class IOPLenumVar provides an interface to enumerated variables defined in an OPL model.

    IDL Synopsis interface IOPLenumVar : IOPLdata { HRESULT getValue([out,retval] IOPLenumValue** ev);};

    Visual Basic Synopsis Class IOPLenumVar Function getValue() As IOPLenumValue

    C++ Synopsis IOPLenumVar : public IOPLdata{public: virtual STDMETHODIMP getValue(IOPLenumValue * *ev) = 0;};

    Member Function HRESULT getValue([out,retval] IOPLenumValue** ev);

    This member function enables the client code to retrieve the value assigned to the OPL enumerated variable interfaced by the invoking object. It assumes that the OPL enumerated variable is bound.

  • IOPLerrorReporterIOPLerrorReporter

    Category COM/ActiveX interface

    Inheritance Path IUnknown

    Description The interface IOPLerrorReporter enables the client code to handle the errors that may be raised during the interaction with the OPL engine.

    In order to ensure error handling, the client code must:

    1. Implement a new class derived from IOPLerrorReporter and redefine the member functions notify*.

    1. Create an instance of this new class; such an object is called an error reporter.2. Use the member function IOPLsolver::setErrorReporter in order to assign the

    error reporter to an instance of IOPLsolver.

    Whenever the OPL engine raises errors concerning the syntax, the semantics or the solving of the model loaded into the IOPLsolver instance, the execution flow is transferred to the appropriate member function of the error reporter.

    IDL Synopsis interface IOPLerrorReporter : IUnknown { HRESULT notifyInternalError([in] BSTR msg); HRESULT notifyRuntimeError([in] int line,[in] BSTR msg); HRESULT notifyRuntimeWarning([in] int line,[in] BSTR msg); HRESULT notifySemanticError([in] int line,[in] BSTR msg); HRESULT notifySyntaxError([in] int line,[in] BSTR msg);};

    Visual Basic Synopsis Class IOPLerrorReporter Sub notifyInternalError(msg As String) Sub notifyRuntimeError(line As Long, msg As String) Sub notifyRuntimeWarning(line As Long, msg As String) Sub notifySemanticError(line As Long, msg As String) Sub notifySyntaxError(line As Long, msg As String)

    C++ Synopsis class IOPLerrorReporter : public IUnknown{public: virtual STDMETHODIMP notifyInternalError(BSTR msg)=0; virtual STDMETHODIMP notifyRuntimeError(int line, BSTR msg)=0; virtual STDMETHODIMP notifyRuntimeWarning(int line, BSTR msg)=0; virtual STDMETHODIMP notifySemanticError(int line, BSTR msg)=0; virtual STDMETHODIMP notifySyntaxError(int line, BSTR msg)=0;};46 I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L

  • IOPLerrorReporterMember Functions HRESULT notifyInternalError([in] BSTR msg);

    The flow of control is transferred to this member function in case the OPL engine raises an internal error.

    HRESULT notifyRuntimeError([in] int line,[in] BSTR msg);

    The flow of control is transferred to this member function whenever the OPL engine detects an error during model solving.

    HRESULT notifyRuntimeWarning([in] int line,[in] BSTR msg);

    This virtual member function handles warning messages that are received when solving with CPLEX. The default error reporter prints the runtime warnings without exiting the process.

    HRESULT notifySemanticError([in] int line,[in] BSTR msg);

    The flow of control is transferred to this member function whenever the OPL engine detects a semantic error.

    HRESULT notifySyntaxError([in] int line,[in] BSTR msg)

    The flow of control is transferred to this member function whenever the OPL engine detects a syntax error.

    See Also IOPLsolver::setErrorReporterI L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L 47

  • 48 I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L

    IOPLfloat

    IOPLfloat

    Category COM/ActiveX interface

    Inheritance Path IOPLdata

    Description IOPLfloat provides an interface to float data defined in an OPL model.

    IDL Synopsis interface IOPLfloat : IOPLdata { HRESULT getClone([out,retval] IOPLfloat** ret); HRESULT getValue([out,retval] double* v); HRESULT setValue([in] double v);};

    Visual Basic Synopsis Class IOPLfloat Function getClone() As IOPLfloat Function getValue() As Double Sub setValue(v As Double)

    C++ Synopsis class IOPLfloat : public IOPLdata{public: virtual STDMETHODIMP getClone(IOPLfloat * *ret) = 0; virtual STDMETHODIMP getValue(double *v) = 0; virtual STDMETHODIMP setValue(double v) = 0;};

    Member Functions HRESULT getClone([out,retval] IOPLfloat** ret);

    This member function enables the client code to construct a new interface object of the same class as the invoking object. The new object interfaces to the same OPL data item as the invoking object.

    HRESULT getValue([out,retval] double* v);

    This member function enables the client code to retrieve the value of the OPL float data interfaced by the invoking object.

    HRESULT setValue([in] double v);

    This member function enables the client code to set the value of the OPL float data interfaced by the invoking object.

  • I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L 49

    IOPLfloatRange

    IOPLfloatRange

    Category COM/ActiveX interface

    Inheritance Path IOPLdata

    Description The class IOPLfloatRange provides an interface to float ranges defined in an OPL model.

    IDL Synopsis interface IOPLfloatRange : IOPLdata { HRESULT getHigh([out,retval] double* v); HRESULT getLow([out,retval] double* v);};

    Visual Basic Synopsis Class IOPLfloatRange Function getHigh() As Double Function getLow() As Double

    C++ Synopsis class IOPLfloatRange : public IOPLdata{public: virtual STDMETHODIMP getHigh(double *v) = 0; virtual STDMETHODIMP getLow(double *v) = 0;};

    Member Functions HRESULT getHigh([out,retval] float* v);

    This member function enables the client code to retrieve the highest value of the OPL float range interfaced by the invoking object.

    HRESULT getLow([out,retval] float* v);

    This member function enables the client code to retrieve the lowest value of the OPL float range interfaced by the invoking object.

  • IOPLfloatVarIOPLfloatVar

    Category COM/ActiveX interface

    Inheritance Path IOPLdata

    Description The class IOPLfloatVar provides an interface to the float variables defined in an OPL model.

    IDL Synopsis interface IOPLfloatVar : IOPLdata { HRESULT getBasisStatus([out,retval] enum IOPLbasisStatus* v); HRESULT getMax([out,retval] double* v); HRESULT getMin([out,retval] double* v); HRESULT getReducedCost([out,retval] double* v); HRESULT getValue([out,retval] double* v);};

    Visual Basic Synopsis Class IOPLfloatVar Function getBasisStatus() As IOPLbasisStatus Function getMax() As Double Function getMin() As Double Function getReducedCost() As Double Function getValue() As Double

    C++ Synopsis public: virtual STDMETHODIMP getValue(double *v) = 0; virtual STDMETHODIMP getMin(double *v) = 0; virtual STDMETHODIMP getMax(double *v) = 0; virtual STDMETHODIMP getReducedCost(double *v) = 0; virtual STDMETHODIMP getBasisStatus(enum IOPLbasisStatus *v) = 0;};

    Member Functions HRESULT getBasisStatus([out,retval] enum IOPLbasisStatus* v);

    This member function enables the client code to retrieve the basis status associated, in a linear OPL model, with the float variable interfaced by the invoking object.

    HRESULT getMax([out,retval] double* v);

    This member function enables the client code to retrieve the maximal value of the domain associated with the OPL float variable interfaced by the invoking object.

    HRESULT getMin([out,retval] double* v);

    This member function enables the client code to retrieve the minimal value of the domain associated with the OPL float variable interfaced by the invoking object.50 I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L

  • IOPLfloatVarHRESULT getReducedCost([out,retval] double* v);

    This member function enables the client code to retrieve the reduced cost associated, in a linear OPL model, with the float variable interfaced by the invoking object.

    HRESULT getValue([out,retval] double* v);

    This member function enables the client code to retrieve the value assigned to the OPL float variable interfaced by the invoking object. It assumes that the OPL float variable is bound.I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L 51

  • 52 I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L

    IOPLint

    IOPLint

    Category COM/ActiveX interface

    Inheritance Path IOPLdata

    Description IOPLint provides an interface to integer data defined in an OPL model.

    IDL Synopsis interface IOPLint : IOPLdata { HRESULT getClone([out,retval] IOPLint** ret); HRESULT getValue([out,retval] int* v); HRESULT setValue([in] int v);};

    Visual Basic Synopsis Class IOPLint Function getClone() As IOPLint Function getValue() As Long Sub setValue(v As Long)

    C++ Synopsis class IOPLint : public IOPLdata{public: virtual STDMETHODIMP getClone(IOPLint * *ret) = 0; virtual STDMETHODIMP getValue(int *v) = 0; virtual STDMETHODIMP setValue(int v) = 0;};

    Member Functions HRESULT getClone([out,retval] IOPLint** ret);

    This member function enables the client code to construct a new interface object of the same class as the invoking object. The new object interfaces to the same OPL data item as the invoking object.

    HRESULT getValue([out,retval] int* v);

    This member function enables the client code to retrieve the value of the OPL integer data interfaced by the invoking object.

    HRESULT setValue([in] int v);

    This member function enables the client code to set the value of the OPL integer data interfaced by the invoking object.

  • I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L 53

    IOPLintRange

    IOPLintRange

    Category COM/ActiveX interface

    Inheritance Path IOPLdata

    Description The class IOPLintRange provides an interface to integer ranges defined in an OPL model.

    IDL Synopsis interface IOPLintRange : IOPLdata { HRESULT getHigh([out,retval] int* v); HRESULT getLow([out,retval] int* v);};

    Visual Basic Synopsis Class IOPLintRange Function getHigh() As Long Function getLow() As Long

    C++ Synopsis class IOPLintRange : public IOPLdata{public: virtual STDMETHODIMP getLow(int *v) = 0; virtual STDMETHODIMP getHigh(int *v) = 0;};

    Member Functions HRESULT getHigh([out,retval] int* v);

    This member function enables the client code to retrieve the highest value of the OPL integer range interfaced by the invoking object.

    HRESULT getLow([out,retval] int* v);

    This member function enables the client code to retrieve the lowest value of the OPL integer range interfaced by the invoking object.

  • 54 I L O G O P L S T U D I O 3 . 7 C O M P O N E N T L I B R A R I E S R E F E R E N C E M A N U A L

    IOPLintVar

    IOPLintVar

    Category COM/ActiveX interface

    Inheritance Path IOPLdata

    Description The class IOPLintVar provides an interface to integer variables defined in an OPL model.

    IDL Synopsis interface IOPLintVar : IOPLdata { HRESULT getMax([out,retval] int* v); HRESULT getMin([out,retval] int* v); HRESULT getValue([out,retval] int* v);};

    Visual Basic Synopsis Class IOPLintVar Function getMax() As Long Function getMin() As Long Function getValue() As Long

    C++ Synopsis class IOPLintVar : public IOPLdata{public: virtual STDMETHODIMP getMax(int *v) = 0; virtual STDMETHODIMP getMin(int *v) = 0; virtual STDMETHODIMP getValue(int *v) = 0;};

    Member Functions HRESULT getMax([out,retval] int* v);

    This member function enables the client code to retrieve the maximal value of the domain associated with the OPL integer variable interfaced by the invoking object.

    HRESULT getMin([out,retval] int* v);

    This member function enables the client code to retrieve the minimal value of the domain associated with the OPL integer variable interfaced by the invoking object.

    HRESULT getValue([out,retval] int* v);

    This member function enables the client code to retrieve the value assigned to the OPL integer variable interfaced by the invoking object. It assumes that the OPL integer variable is bound.

  • IOPLscriptSolverIOPLscriptSolver

    Category COM/ActiveX interface

    Inheritance Path IDispatch

    IDL Synopsis interface IOPLscriptSolver : IDispatch { HRESULT close(); HRESULT registerCplexLicense([in] BSTR license, [in] int signature, [out,retval] int* ret); HRESULT registerOplLicense([in] BSTR license, [in] int signature, [out,retval] int* ret); HRESULT registerSchedulerLicense([in] BSTR license, [in] int signature, [out,retval] int* ret); HRESULT registerSolverLicense([in] BSTR license, [in] int signature, [out,retval] int* ret); HRESULT run([in] BSTR filename,[out,retval] int* ret); HRESULT setDefaultErrorReporterSilen