Changeset 135 for trunk/src/core


Ignore:
Timestamp:
Nov 10, 2005, 7:45:00 PM (19 years ago)
Author:
dkearney
Message:

1) fixed children function in c++'s library module so users can now
search for children by type.
2) adjusted bindings dictionary module for storing lib's to allow caller
to set the key of the value being stored.
3) removed old targets for rappture_interface.o and rappture_fortran.o
from makefile
4) renamed matlab and octave binding functions names to match the module
they came from.
5) adjusted matlab/octave example in examples/app_fermi/matlab
6) added matlab and octave search paths environment variables to
gui/apps/rappture

Location:
trunk/src/core
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/core/RpBindingsDict.cc

    r122 r135  
    2525 * function's caller.
    2626 *
    27  * Returns the key of the object in the dictionary
     27 * Returns the key of the object in the dictionary
     28 * On Error, returns 0 (which also means nothing can be stored at 0)
    2829 */
    2930
    3031int
    31 storeObject_Lib(RpLibrary* objectName) {
    32 
    33     int retVal = -1;
    34     int dictKey = ObjDict_Lib.size() + 1;
     32storeObject_Lib(RpLibrary* objectName, int key) {
     33
     34    int retVal = 0;
     35    int dictKey = key;
    3536    int newEntry = 0;
    3637
     
    3940        // no error checking to make sure it was successful in entering
    4041        // the new entry.
     42
     43        if (dictKey == 0) {
     44            dictKey = ObjDict_Lib.size() + 1;
     45        }
    4146        ObjDict_Lib.set(dictKey,objectName, &newEntry);
    42     }
    43 
    44     retVal = dictKey;
     47        retVal = dictKey;
     48    }
     49
    4550    return retVal;
    4651}
     
    6166getObject_Lib(int objKey) {
    6267
    63     RpLibrary* retVal = *(ObjDict_Lib.find(objKey).getValue());
     68
     69    RpLibrary* retVal = NULL;
     70
     71    retVal = *(ObjDict_Lib.find(objKey).getValue());
    6472
    6573    if (retVal == *(ObjDict_Lib.getNullEntry().getValue())) {
  • trunk/src/core/RpLibrary.cc

    r125 r135  
    478478// METHOD: children()
    479479/// Return the next child of the node located at 'path'
     480//
     481// The lookup is reset when you send a NULL rpChilNode.
     482//
    480483/**
    481484 */
     
    503506        // in the last call to this function.
    504507        // if so, then we dont need to reset the parentNode
    505         if ( path.compare(old_path) == 0 ) {
     508        //
     509        // this check is probably more dependent on rpChildNode
     510        // because we want to see if the person want to continue
     511        // an old search or start from the beginning of the child list
     512        //
     513        if ( (path.compare(old_path) == 0) && (rpChildNode != NULL) ) {
    506514            parentNode = NULL;
    507515        }
     
    526534    if (parentNode) {
    527535        myChildCount = scew_element_count(parentNode);
    528         std::cout << "myChildCount = " << myChildCount << std::endl;
    529536    }
    530537
     
    537544        if (!type.empty()) {
    538545            childName = scew_element_name(childNode);
     546            // we are searching for a specific child name
     547            // keep looking till we find a name that matches the type.
     548            while (type != childName) {
     549                childNode = scew_element_next(parentNode,childNode);
     550                childName = scew_element_name(childNode);
     551            }
    539552            if (type == childName) {
     553                // found a child with a name that matches type
    540554                // clean up old memory
    541                 if (retLib) {
    542                     delete retLib;
    543                 }
     555                delete retLib;
    544556                retLib = new RpLibrary( childNode );
     557            }
     558            else {
     559                // no children with names that match 'type' were found
     560                delete retLib;
     561                retLib = NULL;
    545562            }
    546563        }
    547564        else {
    548565            // clean up old memory
    549             if (retLib) {
    550                 delete retLib;
    551             }
     566            delete retLib;
    552567            retLib = new RpLibrary( childNode );
    553568        }
     
    557572        // its probable there are no more child elements left to report
    558573        // clean up old memory
    559         if (retLib) {
    560             delete retLib;
    561         }
     574        delete retLib;
    562575        retLib = NULL;
    563576    }
  • trunk/src/core/RpNumber.cc

    r121 r135  
    229229}
    230230
     231/**********************************************************************/
     232// METHOD: put()
     233/// Store the information of this Rappture Object into the xml
     234/**
     235 */
     236//
     237//RpNumber&
     238//RpNumber::put() const {
     239//
     240//   
     241//    return *this;
     242//}
     243
    231244
    232245// -------------------------------------------------------------------- //
Note: See TracChangeset for help on using the changeset viewer.