2.2.4.32.11 OriginObject::FindOutgoingOperations

Description

Find UIDs where this object is an input

Syntax

int FindOutgoingOperations( vector<uint> & vUIDs )

Parameters

vUIDs
[output]vector to receive operation UIDs

Return

the size of the vector, or -1 if error.

Examples

EX1

// Have a worksheet active on which some fits or statistics were performed
// The example finds sheet with results that depend on the active worksheet
#include <Origin.h>
#include <operation.h>
static bool find_result_sheets_in_same_book(Worksheet& wks, vector<string>& vsNames)
{
    WorksheetPage wp = wks.GetPage();
    if(!wp)
        return false;
    vector<uint> unOpIDs;
    if(wks.FindOutgoingOperations(unOpIDs) <= 0)
        return false;
    vsNames.SetSize(0);
    for(int ii = 0; ii < unOpIDs.GetSize(); ii++)
    {
        Operation &op = (Operation &)Project.GetOperationObject(unOpIDs[ii]);
        if(op)
        {
            DataRange dr;
            Worksheet wResult;
            if(op_get_output(op, dr, wResult) && (wResult.GetSystemParam(0) & WP_SHEET_HIERARCHY)) // only consider hierarical sheet
            {
                WorksheetPage wpr = wResult.GetPage();
                if(wpr.GetName() == wp.GetName())
                    vsNames.Add(wResult.GetName());
            }
        }
    }
    return true;
}
void OriginObject_FindOutgoingOperations_Ex1()
{
    Worksheet wks = Project.ActiveLayer();
    vector<string> vsResultSheets;
    if(find_result_sheets_in_same_book(wks, vsResultSheets))
    {
        for(int ii = 0; ii < vsResultSheets.GetSize(); ii++)
            out_str(vsResultSheets[ii]);
    }
}

Remark

Retrieve the UIDs of all the operations that have this object or any parts thereof (like the input DataRange intersects with a column of 'this' OriginObj which could be a column, a sheet, or a book) as input.

See Also

OriginObject::FindIncomingOperations Project::GetOperationObject

Header to Include

origin.h