您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ EXCEPTION0函数代码示例

51自学网 2021-06-01 20:35:55
  C++
这篇教程C++ EXCEPTION0函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中EXCEPTION0函数的典型用法代码示例。如果您正苦于以下问题:C++ EXCEPTION0函数的具体用法?C++ EXCEPTION0怎么用?C++ EXCEPTION0使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

在下文中一共展示了EXCEPTION0函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: EXCEPTION0

voidavtLineScanQuery::WalkChain1(vtkPolyData *pd, int ptId, int cellId,                             vtkIntArray *lineids, int lineid,                              int &newPtId, int &newCellId){    static vtkIdList *list = vtkIdList::New();    list->Reset();    pd->GetCellPoints(cellId, list);    if (list->GetNumberOfIds() != 2)    {        EXCEPTION0(ImproperUseException);    }    int id1 = list->GetId(0);    int id2 = list->GetId(1);    newPtId = (id1 == ptId ? id2 : id1);    int seg1, seg2;    int numMatches = GetCellsForPoint(newPtId, pd, lineids, lineid, seg1, seg2);    if (numMatches <= 1)        newCellId = -1;    else if (numMatches > 2)    {        EXCEPTION0(ImproperUseException);    }    else    {        newCellId = (seg1 == cellId ? seg2 : seg1);    }}
开发者ID:burlen,项目名称:visit_vtk_7_src,代码行数:29,


示例2: EXCEPTION0

voidavtOpacityMap::SetTable(RGBA *arr, int te, double attenuation){    if (attenuation < 0. || attenuation > 1.)    {        debug1 << "Bad attenuation value " << attenuation << std::endl;        EXCEPTION0(ImproperUseException);    }    if (table != NULL)    {        delete [] table;    }    tableEntries = te;    table = new RGBA[tableEntries];    for (int i = 0 ; i < tableEntries ; i++)    {        table[i].R = arr[i].R;        table[i].G = arr[i].G;        table[i].B = arr[i].B;        table[i].A = arr[i].A * attenuation;        if (table[i].A < 0. || table[i].A > 1.)        {            debug1 << "Bad value " << table[i].A << std::endl;            EXCEPTION0(ImproperUseException);        }    }    //    // We need to set the intermediate vars again since the table size has    // potentially changed.    //    SetIntermediateVars();}
开发者ID:HarinarayanKrishnan,项目名称:VisIt28RC_Trunk,代码行数:35,


示例3: if

avtDataTree_pavtCurveCMFEExpression::ExecuteTree(avtDataTree_p tree1, avtDataTree_p tree2,                                   const std::string &invar,                                   const std::string &outvar){   if (tree1->GetNumberOfLeaves() == 0)        return tree1;    else if (tree1->GetNumberOfLeaves() != 1)        EXCEPTION0(ImproperUseException);    if (tree2->GetNumberOfLeaves() == 0)        return tree1;    else if (tree2->GetNumberOfLeaves() != 1)        EXCEPTION0(ImproperUseException);    //    // We know that there is only one leaf node.  It is the curve.    //    vtkRectilinearGrid *curve1 =         vtkRectilinearGrid::SafeDownCast(tree1->GetSingleLeaf());    if (curve1 == NULL)        EXCEPTION0(ImproperUseException);    vtkRectilinearGrid *curve2 =         vtkRectilinearGrid::SafeDownCast(tree2->GetSingleLeaf());    if (curve2 == NULL)        EXCEPTION0(ImproperUseException);    vtkRectilinearGrid *rg =         MergeCurvesToSameXIntervals(curve1, curve2, outvar);    avtDataTree_p output = new avtDataTree(rg, 1);    rg->Delete();    return output;}
开发者ID:burlen,项目名称:visit_vtk_7_src,代码行数:34,


示例4: EXCEPTION0

avtDataObject_pavtDataObjectReader::GetOutput(void){    if (!haveInput)    {        EXCEPTION0(NoInputException);    }    if      (InputIsDataset())  return datasetReader->GetOutput();    else if (InputIsImage())    return imageReader->GetOutput();    else if (InputIsNullData()) return nullDataReader->GetOutput();    else                       EXCEPTION0(NoInputException);}
开发者ID:OSCCAR-PFM,项目名称:OSCCAR-dev,代码行数:13,


示例5: Accept

// ****************************************************************************//  Method:  SocketBridge::StartNewBridge////  Purpose://    Start a new bridge by accepting a new incoming connection and making//    a new outbound connection.  This assumes there is already an incoming//    connection attempt pending.////  Programmer:  Jeremy Meredith//  Creation:    May 24, 2007////  Modifications://    Gunther H. Weber, Thu Jan 14 11:38:27 PST 2010//    Added ability to connect bridge to other host than localhost.//// ****************************************************************************voidSocketBridge::StartNewBridge(){    int ofd = Accept(listen_fd, listen_sock);    if (ofd == -1)        EXCEPTION0(CouldNotConnectException);    originating_fd[num_bridges] = ofd;    int tfd = Connect(to_host, to_port);    if (tfd == -1)        EXCEPTION0(CouldNotConnectException);    terminating_fd[num_bridges] = tfd;    num_bridges++;}
开发者ID:HarinarayanKrishnan,项目名称:VisIt26RC_Trunk,代码行数:31,


示例6: EXCEPTION0

voidavtExtents::CopyTo(double *exts){    if (exts == NULL)    {        //        // How can we copy into a NULL array?        //        EXCEPTION0(ImproperUseException);    }    if (extents == NULL)    {        //        // We don't have extents, so copy in the biggest bounds possible.        //        for (int i = 0 ; i < dimension ; i++)        {            exts[2*i]   = +DBL_MAX;            exts[2*i+1] = -DBL_MAX;        }    }    else    {        //        // The most common case -- copy our extents over.        //        for (int i = 0 ; i < 2*dimension ; i++)        {            exts[i] = extents[i];        }    }}
开发者ID:OSCCAR-PFM,项目名称:OSCCAR-dev,代码行数:33,


示例7: GetFileList

const GetFileListRPC::FileList *GetFileListRPC::operator()(const std::string &f, bool grouping,    bool smartGrouping){    debug3 << "Executing GetFileList(" << f.c_str()           << (grouping?"true":"false") << ", "           << (smartGrouping?"true":"false") << ", "           << ") RPC/n";    // Store the arguments.    filter = f;    automaticFileGrouping = grouping;    smartFileGrouping = smartGrouping;    // Try to execute the RPC.    Execute();    // If the RPC returned an error, throw an exception.    if(GetReply()->GetStatus() == error)    {        EXCEPTION0(GetFileListException);    }    return &fileList;}
开发者ID:burlen,项目名称:visit_vtk_7_src,代码行数:25,


示例8: EXCEPTION0

voidavtOpacityMap::SetTable(unsigned char *arr, int te, double attenuation){    if (attenuation < 0. || attenuation > 1.)    {        debug1 << "Bad attenuation value " << attenuation << endl;        EXCEPTION0(ImproperUseException);    }    if (table != NULL)    {        delete [] table;    }    tableEntries = te;    table = new RGBA[tableEntries];    for (int i = 0 ; i < tableEntries ; i++)    {        table[i].R = arr[i*4];        table[i].G = arr[i*4+1];        table[i].B = arr[i*4+2];        table[i].A = ((float) arr[i*4+3] / 255.) * attenuation;    }    //    // We need to set the intermediate vars again since the table size has    // potentially changed.    //    SetIntermediateVars();}
开发者ID:HarinarayanKrishnan,项目名称:VisIt26RC_Trunk,代码行数:30,


示例9: EXCEPTION0

voidavtVMetricVolume::MetricForWholeMesh(vtkDataSet *ds, vtkDataArray *rv){    if (ds->GetDataObjectType() != VTK_RECTILINEAR_GRID)        EXCEPTION0(ImproperUseException);    vtkRectilinearGrid *rg = (vtkRectilinearGrid *) ds;    vtkDataArray *X = rg->GetXCoordinates();    vtkDataArray *Y = rg->GetYCoordinates();    vtkDataArray *Z = rg->GetZCoordinates();    int dims[3];    rg->GetDimensions(dims);    double *Xdist = new double[dims[0]-1];    for (int i = 0 ; i < dims[0]-1 ; i++)        Xdist[i] = X->GetTuple1(i+1) - X->GetTuple1(i);    double *Ydist = new double[dims[1]-1];    for (int i = 0 ; i < dims[1]-1 ; i++)        Ydist[i] = Y->GetTuple1(i+1) - Y->GetTuple1(i);    double *Zdist = new double[dims[2]-1];    for (int i = 0 ; i < dims[2]-1 ; i++)        Zdist[i] = Z->GetTuple1(i+1) - Z->GetTuple1(i);    for (int k = 0 ; k < dims[2]-1 ; k++)        for (int j = 0 ; j < dims[1]-1 ; j++)            for (int i = 0 ; i < dims[0]-1 ; i++)            {                int idx = k*(dims[1]-1)*(dims[0]-1) + j*(dims[0]-1) + i;                double vol = Xdist[i]*Ydist[j]*Zdist[k];                rv->SetTuple1(idx, vol);            }    delete [] Xdist;    delete [] Ydist;    delete [] Zdist;}
开发者ID:burlen,项目名称:visit_vtk_7_src,代码行数:35,


示例10: EXCEPTION0

voidavtGeometryDrawable::Remove(vtkRenderer *ren){    if (ren != renderer)    {        EXCEPTION0(ImproperUseException);    }    for (int i = 0 ; i < nActors ; i++)    {        if (actors[i] != NULL)        {            //            // This is supposed to approximate the RemoveActor call of            // vtkRenderer.  That call also tells the actor to release its            // graphics resources, which does not work well for us, since            // we remove the actors every time we add new plots (the viewer            // does a ClearPlots) and also when the vis window re-orders the            // actors.            //            // THIS IS A MAINTENANCE ISSUE.  This routine should be the same            // as vtkRenderer::RemoveActor, but does not call            // ReleaseGraphicsResources (which is actually called indirectly            // through vtkViewport::RemoveProp).            //            //ren->RemoveActor(actors[i]);            //            ren->GetActors()->RemoveItem(actors[i]);            actors[i]->RemoveConsumer(ren);            ren->GetViewProps()->RemoveItem(actors[i]);        }    }    renderer = NULL;}
开发者ID:burlen,项目名称:visit_vtk_7_src,代码行数:34,


示例11: EXCEPTION0

unsigned char *avtImageRepresentation::GetImageString(int &length, bool compress){    if (asChar == NULL)    {        if (asVTK == NULL)        {            EXCEPTION0(NoInputException);        }        CreateStringFromInput(asVTK, zbuffer, asChar, asCharLength);        asCharRef = new int(1);    }    if (compress)    {        int asCharLengthNew = 0;        unsigned char *asCharNew = 0;        if (CCompressDataString(asChar, asCharLength,                                &asCharNew, &asCharLengthNew,                                &timeToCompress, &compressionRatio))        {            delete [] asChar;            asChar = asCharNew;            asCharLength = asCharLengthNew;        }    }    length = asCharLength;    return asChar;}
开发者ID:HarinarayanKrishnan,项目名称:VisIt28RC_Trunk,代码行数:32,


示例12: while

voidEngineMethods::GetProcInfo(ProcessAttributes &retAtts){    state->procInfoRPC();    // Get the reply and update the progress bar    while (state->procInfoRPC.GetStatus() == VisItRPC::incomplete ||           state->procInfoRPC.GetStatus() == VisItRPC::warning)    {        state->procInfoRPC.RecvReply();    }    // Check for abort    if (state->procInfoRPC.GetStatus() == VisItRPC::abort)    {        ClearStatus();        EXCEPTION0(AbortException);    }    // Check for an error    if (state->procInfoRPC.GetStatus() == VisItRPC::error)    {        RECONSTITUTE_EXCEPTION(state->procInfoRPC.GetExceptionType(),                               state->procInfoRPC.Message());    }    retAtts = state->procInfoRPC.GetReturnAtts();}
开发者ID:HarinarayanKrishnan,项目名称:VisIt28RC_Trunk,代码行数:29,


示例13: EXCEPTION0

void avtHexahedron20Extractor::QuadraticHexExtract(const avtHexahedron20 &hex){    cerr << "avtHexahedron20Extractor::QuadraticHexExtract not implemented yet"         << endl;    EXCEPTION0(ImproperUseException);}
开发者ID:EricAlex,项目名称:ThirdParty-dev,代码行数:7,


示例14: FindIndex

voidDBOptionsAttributes::SetEnumStrings(const std::string &name,                                    const std::vector<std::string> &values){    int eIndex = FindIndex(name);    if (eIndex < 0)        EXCEPTION0(BadDeclareFormatString);    int numEnums = (int)optEnums.size();    std::vector<std::string> newList;    int idx = 0;    for (int i = 0 ; i < numEnums ; i++)    {        if (i == eIndex)        {            for (size_t j = 0 ; j < values.size() ; j++)                newList.push_back(values[j]);        }        else        {            for (int j = 0 ; j < enumStringsSizes[i] ; j++)                newList.push_back(enumStrings[idx+j]);        }        idx += enumStringsSizes[i];    }    enumStrings = newList;    enumStringsSizes[eIndex] = values.size();}
开发者ID:robertmaynard,项目名称:VisIt-Bridge,代码行数:28,


示例15: while

int avtLineScanQuery::WalkChain(vtkPolyData *pd, int ptId, int cellId,                             std::vector<bool> &usedPoint,                            vtkIntArray *lineids, int lineid){    static vtkIdList *list = vtkIdList::New();    bool haventFoundEnd = true;    int  curCell = cellId;    int  curPt   = ptId;    int  endOfChain = -1;    int  counter = 0;    while (haventFoundEnd)    {        list->Reset();        pd->GetCellPoints(curCell, list);        if (list->GetNumberOfIds() != 2)        {            EXCEPTION0(ImproperUseException);        }        int id1 = list->GetId(0);        int id2 = list->GetId(1);        int newId = (id1 == curPt ? id2 : id1);        usedPoint[newId] = true;        int seg1, seg2;        int numMatches =                       GetCellsForPoint(newId, pd, lineids, lineid, seg1, seg2);        if (numMatches <= 1)        {            haventFoundEnd = false;            endOfChain = newId;        }        else if (numMatches > 2)        {            // This is an error condition.  It is believed to occur when            // a line coincides with an edge.  Empirically, it is believed            // to happen about one time when you cast 100K lines over 90M            // zones.  So: it doesn't happen often, but it happens enough.            // In this case, just ignoring the line won't affect statistics.            haventFoundEnd = false;            endOfChain = -1;        }        else        {            curPt = newId;            curCell = (seg1 == curCell ? seg2 : seg1);        }        if (counter++ > 1000000)        {            haventFoundEnd = false;            endOfChain = -1;        }    }    return endOfChain;}
开发者ID:burlen,项目名称:visit_vtk_7_src,代码行数:59,


示例16: EXCEPTION0

vtkDataSet *avtUniformBinningScheme::CreateGrid(void) const{    int  i, j;    if (ntuples > 3)    {        EXCEPTION0(ImproperUseException);    }    vtkRectilinearGrid *rgrid = vtkRectilinearGrid::New();    int dims[3] = { 1, 1, 1 };    for (i = 0 ; i < 3 ; i++)    {        vtkFloatArray *arr = vtkFloatArray::New();        if (i < ntuples)        {            if (ntuples == 1) // curve ... set up for point data            {                arr->SetNumberOfTuples(nvals[i]);                float start = ranges[2*i];                float stop  = ranges[2*i+1];                float step  = (stop - start) / (nvals[i]);                for (j = 0 ; j < nvals[i] ; j++)                {                    arr->SetValue(j, start + j*step + step/2.0);                }            }            else // 2D or 3D ... set up for cell data            {                arr->SetNumberOfTuples(nvals[i]+1);                float start = ranges[2*i];                float stop  = ranges[2*i+1];                float step  = (stop - start) / (nvals[i]);                for (j = 0 ; j < nvals[i]+1 ; j++)                {                    arr->SetValue(j, start + j*step);                }            }        }        else        {            arr->SetNumberOfTuples(1);            arr->SetValue(0, 0.);        }        dims[i] = arr->GetNumberOfTuples();        if (i == 0)            rgrid->SetXCoordinates(arr);        else if (i == 1)            rgrid->SetYCoordinates(arr);        else if (i == 2)            rgrid->SetZCoordinates(arr);        arr->Delete();    }    rgrid->SetDimensions(dims);    return rgrid;}
开发者ID:burlen,项目名称:visit_vtk_7_src,代码行数:59,


示例17: EXCEPTION0

DBOptionsAttributes::OptionTypeDBOptionsAttributes::GetType(int index) const{    if (index < 0 || index >= types.size())        EXCEPTION0(BadDeclareFormatString);    return (DBOptionsAttributes::OptionType) types[index];}
开发者ID:robertmaynard,项目名称:VisIt-Bridge,代码行数:8,


示例18: EXCEPTION0

voidavtDataObject::CompatibleTypes(avtDataObject *dob){    if (strcmp(GetType(), dob->GetType()) != 0)    {        EXCEPTION0(ImproperUseException);    }}
开发者ID:OSCCAR-PFM,项目名称:OSCCAR-dev,代码行数:8,


示例19: EXCEPTION0

boolavtFileWriter::IsImageFormat(void){    if (format < 0)    {        EXCEPTION0(ImproperUseException);    }    return isImage;}
开发者ID:HarinarayanKrishnan,项目名称:VisIt26RC_Trunk,代码行数:9,


示例20: EXCEPTION0

avtDataTree_pavtDatasetSink::GetInputDataTree(){    if (*input == NULL)    {        EXCEPTION0(NoInputException);    }    return input->GetDataTree();}
开发者ID:HarinarayanKrishnan,项目名称:VisIt28RC_Trunk,代码行数:10,



注:本文中的EXCEPTION0函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


C++ EXCEPTION1函数代码示例
C++ EXCEPTION函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。