예제 #1
0
파일: simple.cpp 프로젝트: cornelius/kode
Simple Simple::parseFile( const QString &filename, bool *ok )
{
  QFile file( filename );
  if ( !file.open( QIODevice::ReadOnly ) ) {
    qCritical() << "Unable to open file '" << filename << "'";
    if ( ok ) *ok = false;
    return Simple();
  }

  QString errorMsg;
  int errorLine, errorCol;
  QDomDocument doc;
  if ( !doc.setContent( &file, false, &errorMsg, &errorLine, &errorCol ) ) {
    qCritical() << errorMsg << " at " << errorLine << "," << errorCol;
    if ( ok ) *ok = false;
    return Simple();
  }

  qDebug() << "CONTENT:" << doc.toString();

  bool documentOk;
  Simple c = parseElement( doc.documentElement(), &documentOk );
  if ( ok ) {
    *ok = documentOk;
  }
  return c;
}
예제 #2
0
파일: mainwindow.cpp 프로젝트: krang4d/code
void MainWindow::on_actionNewWindow_triggered()
{
    myDialog *dialog = new myDialog(this);
    dialog->show();

    str *n = new str;

    QObject::connect(dialog,SIGNAL(Simple(QString)),n,SLOT(Simple(QString)));
    QObject::connect(dialog,SIGNAL(Invers(QString)),n,SLOT(Inversia(QString)));
    QObject::connect(dialog,SIGNAL(Register(QString)),n,SLOT(Register(QString)));
    QObject::connect(dialog,SIGNAL(RegisterAndInvers(QString)),n,SLOT(All(QString)));
}
예제 #3
0
파일: simplest.cpp 프로젝트: ivandzen/HSDB
simplest::Simple simplest::Simple::create()  {
    if(instanceCount() == 0)
        return Simple();
    Simple result = popFreeSimple();
    if(!result.isValid())
    {
        if(getUsed() >= instanceCount())
            reallocInstances(instanceCount() << 1);
        result = Simple(getUsed());
        setUsed(getUsed() + 1);
    }
    result.reset();
    result.onCreate();
    return result;
}
예제 #4
0
int main()
{
    double x=0.5;
    printf("The simple way:\n");
    Simple(1,x);
    printf("The Steffense way:\n");
    Steffensen(1,x);
    return 0;
}
예제 #5
0
int
main ()
{
  int a = ONE + TWO; // Break here

  #undef MACRO_2
  #undef FOUR

  return Simple().Method();
}
예제 #6
0
//简单迭代法函数
void Simple(int i,double x)
{
    double a;
    a=NumOfFunction(x);
    printf("第%d次:%fl\n",i,a);
    if(fabs(a-x)>=pow(10,-5))
    {
        Simple(i+1,a);
    }
}
예제 #7
0
파일: Math.cpp 프로젝트: abma/streflop
namespace streflop {

	// MSVC chokes on these constants,
	// TODO: we need another way to specify them. (hardcode the bitpattern?)
#ifndef _MSC_VER

    // Constants

    const Simple SimplePositiveInfinity = Simple(1.0f) / Simple(0.0f);
    const Simple SimpleNegativeInfinity = Simple(-1.0f) / Simple(0.0f);
    // TODO: non-signaling version
    const Simple SimpleNaN = SimplePositiveInfinity + SimpleNegativeInfinity;

    const Double DoublePositiveInfinity = Double(1.0f) / Double(0.0f);
    const Double DoubleNegativeInfinity = Double(-1.0f) / Double(0.0f);
    // TODO: non-signaling version
    const Double DoubleNaN = DoublePositiveInfinity + DoubleNegativeInfinity;

// Extended are not always available
#ifdef Extended

    const Extended ExtendedPositiveInfinity = Extended(1.0f) / Extended(0.0f);
    const Extended ExtendedNegativeInfinity = Extended(-1.0f) / Extended(0.0f);
    // TODO: non-signaling version
    const Extended ExtendedNaN = ExtendedPositiveInfinity + ExtendedNegativeInfinity;

#endif

#endif // _MSC_VER


    // Default environment. Initalized to 0, and really set on first access
#if defined(STREFLOP_X87)
    fenv_t FE_DFL_ENV = 0;
#elif defined(STREFLOP_SSE)
    fenv_t FE_DFL_ENV = {0,0};
#elif defined(STREFLOP_SOFT)
    fenv_t FE_DFL_ENV = {42,0,0};
#else
#error STREFLOP: Invalid combination or unknown FPU type.
#endif

}
예제 #8
0
void CHelloTraceFn::PreProcessedFn(TInt aDbgParam)
{
    OstTraceExt2( TRACE_FLOW, CHELLOTRACEFN_PREPROCESSEDFN_ENTRY_1, "CHelloTraceFn::PreProcessedFn: > CHelloTraceFn::PreProcessedFn;aDbgParam=%d;this=%x", (TInt) aDbgParam, (TUint) this);
#else
void CHelloTraceFn::PreProcessedFn()
{
    OstTrace1( TRACE_FLOW, CHELLOTRACEFN_PREPROCESSEDFN_ENTRY_2, "CHelloTraceFn::PreProcessedFn: > CHelloTraceFn::PreProcessedFn;this=%x", (TUint) this);
#endif
    Simple();
    OstTrace1( TRACE_FLOW, CHELLOTRACEFN_PREPROCESSEDFN_EXIT, "CHelloTraceFn::PreProcessedFn: < CHelloTraceFn::PreProcessedFn;this=%x", (TUint) this);
}
예제 #9
0
파일: simplest.cpp 프로젝트: ivandzen/HSDB
simplest::Simple simplest::Simple::popFreeSimple()  {
    Simple result = getFirstFreeSimple();
    if(result.isValid())
    {
        result.removeFreeSimpleHandler();
        setFirstFreeSimple(result.getNextSimpleFreeSimple());
        result.setNextSimpleFreeSimple(Simple());
        setNumFreeSimples(getNumFreeSimples() - 1);
    }
    return result;
}
예제 #10
0
파일: SMath.cpp 프로젝트: slogic/spring
namespace streflop {

    // Constants

    const Simple SimpleZero(0.0f);
    const Simple SimplePositiveInfinity = Simple(1.0f) / SimpleZero;
    const Simple SimpleNegativeInfinity = Simple(-1.0f) / SimpleZero;
    // TODO: non-signaling version
    const Simple SimpleNaN = SimplePositiveInfinity + SimpleNegativeInfinity;

    const Double DoubleZero(0.0f);
    const Double DoublePositiveInfinity = Double(1.0f) / DoubleZero;
    const Double DoubleNegativeInfinity = Double(-1.0f) / DoubleZero;
    // TODO: non-signaling version
    const Double DoubleNaN = DoublePositiveInfinity + DoubleNegativeInfinity;

// Extended are not always available
#ifdef Extended

    const Extended ExtendedZero(0.0f);
    const Extended ExtendedPositiveInfinity = Extended(1.0f) / ExtendedZero;
    const Extended ExtendedNegativeInfinity = Extended(-1.0f) / ExtendedZero;
    // TODO: non-signaling version
    const Extended ExtendedNaN = ExtendedPositiveInfinity + ExtendedNegativeInfinity;

#endif



    // Default environment. Initialized to 0, and really set on first access
#if defined(STREFLOP_X87)
    fenv_t FE_DFL_ENV = 0;
#elif defined(STREFLOP_SSE)
    fenv_t FE_DFL_ENV = {0,0};
#elif defined(STREFLOP_SOFT)
    fenv_t FE_DFL_ENV = {42,0,0};
#else
#error STREFLOP: Invalid combination or unknown FPU type.
#endif

}
예제 #11
0
파일: simple.cpp 프로젝트: cornelius/kode
Simple Simple::parseElement( const QDomElement &element, bool *ok )
{
  if ( element.tagName() != "simple" ) {
    qCritical() << "Expected 'simple', got '" <<element.tagName() << "'.";
    if ( ok ) *ok = false;
    return Simple();
  }

  Simple result = Simple();

  QDomNode n;
  for( n = element.firstChild(); !n.isNull(); n = n.nextSibling() ) {
    QDomElement e = n.toElement();
    if ( e.tagName() == "food" ) {
      bool ok;
      Food o = Food::parseElement( e, &ok );
      if ( ok ) result.addFood( o );
    }
  }


  if ( ok ) *ok = true;
  return result;
}
예제 #12
0
파일: simplest.cpp 프로젝트: ivandzen/HSDB
Bool simplest::Simple::removeFreeSimple(const Simple & child)  {
    if( !child.isExists() )
        return false;
    Simple prev;
    Simple current;
    for(current = getFirstFreeSimple(); current.isValid() && current != child; current = current.getNextSimpleFreeSimple())
        prev = current;
    if(!current.isValid())
    {
        return false; //! data corrupted
    }
    current.removeFreeSimpleHandler();
    if(prev.isValid())
        prev.setNextSimpleFreeSimple(current.getNextSimpleFreeSimple());
    else
        setFirstFreeSimple(current.getNextSimpleFreeSimple());
    current.setNextSimpleFreeSimple(Simple());
    setNumFreeSimples(getNumFreeSimples() - 1);
    return true;
}
예제 #13
0
DRIVER_ERROR Header400::Send()
// Sends 400-style header to printer.
{
    DRIVER_ERROR err;

    err = thePrinter->Send((const BYTE*)Reset,sizeof(Reset));
    ERRCHECK;

    err = Modes();            // Set media source, type, size and quality modes.
    ERRCHECK;

    err = Margins();          // set margins
    ERRCHECK;

    err = Simple();           // set color mode and resolution
    ERRCHECK;

    err = Graphics();     // start raster graphics and set compression mode

return err;
}
예제 #14
0
static int EndDocument(void *UserData)
{
	Simple("endDocument");
	return 0;
}
예제 #15
0
static int StartDocument(void *UserData)
{
	Simple("startDocument");
	return 0;
}
예제 #16
0
static int EndCDATA(void *UserData)
{
	Simple("endCDATA");
	return 0;
}
예제 #17
0
int
main (int argc, char *argv[])
{

  if (argc > 1)
    {

	  /* Help */
	  if (!strcmp(argv[1], "-h") || !strcmp(argv[1], "-H") || !strcmp(argv[1],
			  "--help") || !strcmp(argv[1], "--Help"))
	    {
		  Help ();
		  return 0;
	    }

	  /* run tests */
	  if(strcmp(argv[1], "test")==0)
	    {
		  /* To enable a test, please modify the file LTE-Sim/src/TESTS/test.h */
		  Test ();
	    }

      /* Run simple scenario */
	  if (strcmp(argv[1], "Simple")==0)
	    {
		  Simple ();
	    }


/*Mouan*/
	  /*
	if (strcmp(argv[1], "mouan")==0)
	    {
		  int nbCells = atoi(argv[2]);
		  double radius = atof(argv[3]);
	      int nbUE = atoi(argv[4]);
	      int nbVoIP = atoi(argv[5]);
	      int nbVideo = atoi(argv[6]);
	      int nbBE = atoi(argv[7]);
	      int nbCBR = atoi(argv[8]);
	      int sched_type = atoi(argv[9]);
	      int frame_struct = atoi(argv[10]);
	      int speed = atoi(argv[11]);
	      double maxDelay = atof(argv[12]);
		  int video_bit_rate = atoi(argv[13]);
	      int seed;
	      if (argc==14) seed = atoi(argv[13]);
	      else seed = -1;
	      MouanCell (nbCells, radius, nbUE, nbVoIP, nbVideo, nbBE, nbCBR, sched_type, frame_struct, speed, maxDelay, video_bit_rate, seed);
	    }*/





      /* Run more complex scenarios */
	  if (strcmp(argv[1], "SingleCell")==0)
	    {
	      double radius = atof(argv[2]);
	      int nbUE = atoi(argv[3]);
	      int nbVoIP = atoi(argv[4]);
	      int nbVideo = atoi(argv[5]);
	      int nbBE = atoi(argv[6]);
	      int nbCBR = atoi(argv[7]);
	      int sched_type = atoi(argv[8]);
	      int frame_struct = atoi(argv[9]);
	      int speed = atoi(argv[10]);
	      double maxDelay = atof(argv[11]);
		  int video_bit_rate = atoi(argv[12]);
	      int seed;
	      if (argc==14) seed = atoi(argv[13]);
	      else seed = -1;
	      SingleCellWithoutInterference (radius, nbUE, nbVoIP, nbVideo, nbBE, nbCBR, sched_type, frame_struct, speed, maxDelay, video_bit_rate, seed);
	    }
	  if (strcmp(argv[1], "SingleCellWithI")==0)
	    {
		  int nbCells = atoi(argv[2]);
		  double radius = atof(argv[3]);
	      int nbUE = atoi(argv[4]);
	      int nbVoIP = atoi(argv[5]);
	      int nbVideo = atoi(argv[6]);
	      int nbBE = atoi(argv[7]);
	      int nbCBR = atoi(argv[8]);
	      int sched_type = atoi(argv[9]);
	      int frame_struct = atoi(argv[10]);
	      int speed = atoi(argv[11]);
	      double maxDelay = atof(argv[12]);
		  int video_bit_rate = atoi(argv[13]);
	      int seed;
	      if (argc==14) seed = atoi(argv[13]);
	      else seed = -1;
	      SingleCellWithInterference (nbCells, radius, nbUE, nbVoIP, nbVideo, nbBE, nbCBR, sched_type, frame_struct, speed, maxDelay, video_bit_rate, seed);
	    }
	  if (strcmp(argv[1], "MultiCell")==0)
	    {
		  int nbCells = atoi(argv[2]);
		  double radius = atof(argv[3]);
	      int nbUE = atoi(argv[4]);
	      int nbVoIP = atoi(argv[5]);
	      int nbVideo = atoi(argv[6]);
	      int nbBE = atoi(argv[7]);
	      int nbCBR = atoi(argv[8]);
	      int sched_type = atoi(argv[9]);
	      int frame_struct = atoi(argv[10]);
	      int speed = atoi(argv[11]);
	      double maxDelay = atof(argv[12]);
		  int video_bit_rate = atoi(argv[13]);
	      int seed;
	      if (argc==14) seed = atoi(argv[13]);
	      else seed = -1;
	      MultiCell (nbCells, radius, nbUE, nbVoIP, nbVideo, nbBE, nbCBR, sched_type, frame_struct, speed, maxDelay, video_bit_rate, seed);
	    }

	  if (strcmp(argv[1], "SingleCellWithFemto")==0)
		{
		  int nbBuilding = atoi(argv[2]);
		  int buildingType = atoi(argv[3]);
		  double activityRatio = atof(argv[4]);
		  double radius = atof(argv[5]);
		  int nbUE = atoi(argv[6]);
		  int nbFemtoUE = atoi(argv[7]);
		  int nbVoIP = atoi(argv[8]);
		  int nbVideo = atoi(argv[9]);
		  int nbBE = atoi(argv[10]);
		  int nbCBR = atoi(argv[11]);
		  int sched_type = atoi(argv[12]);
		  int frame_struct = atoi(argv[13]);
		  int speed = atoi(argv[14]);
		  int accessPolicy = atoi(argv[15]);
		  double maxDelay = atof(argv[16]);
		  int video_bit_rate = atoi(argv[17]);
		  int seed;
		  if (argc==14) seed = atoi(argv[13]);
		  else seed = -1;
		  SingleCellWithFemto ( nbBuilding, buildingType, activityRatio, radius, nbUE, nbFemtoUE, nbVoIP, nbVideo, nbBE, nbCBR, sched_type, frame_struct, speed, accessPolicy, maxDelay, video_bit_rate, seed);
		}
	  if (strcmp(argv[1], "SingleCellWithStreets")==0)
		{
		  int nbStreets = atoi(argv[2]);
		  double radius = atof(argv[3]);
		  int nbUE = atoi(argv[4]);
		  int nbFemtoUE = atoi(argv[5]);
		  int nbVoIP = atoi(argv[6]);
		  int nbVideo = atoi(argv[7]);
		  int nbBE = atoi(argv[8]);
		  int nbCBR = atoi(argv[9]);
		  int sched_type = atoi(argv[10]);
		  int frame_struct = atoi(argv[11]);
		  int speed = atoi(argv[12]);
		  double maxDelay = atof(argv[13]);
		  int video_bit_rate = atoi(argv[14]);
	      int seed;
	      if (argc==14) seed = atoi(argv[13]);
	      else seed = -1;
		  SingleCellWithStreets ( radius, nbStreets, nbUE, nbFemtoUE, nbVoIP, nbVideo, nbBE, nbCBR, sched_type, frame_struct, speed, maxDelay, video_bit_rate, seed);
		}










	  /* other dedicated simulations */
	  if (strcmp(argv[1], "test-amc-mapping")==0)
		{
		  int cells = atoi(argv[2]);
		  double radius = atof(argv[3]);
		  int speed = atoi(argv[4]);
		  int bandwidth = atoi(argv[5]);
		  int cluster = atoi(argv[6]);

		  TestAmcMapping (cells, radius, speed, bandwidth, cluster);
		}
	  if (strcmp(argv[1], "test-mobility-model")==0)
		{
		  double radius = atof(argv[2]);
		  int nbUE = atoi(argv[3]);
		  int model = atoi(argv[4]);
		  int speed = atoi(argv[5]);
		  double duration = atoi(argv[6]);
		  TestMobilityModels(radius, nbUE, model, speed, duration);
		}
	  if (strcmp(argv[1], "scalability-test-macro-with-femto")==0)
		{
		  double radius = atof(argv[2]);
		  int nbBuildings = atoi(argv[3]);
		  int nbUE = atoi(argv[4]);
		  ScalabilityTestMacroWithFemto (radius, nbBuildings, nbUE);
		}

	  if (strcmp(argv[1], "test-sinr-urban")==0)
		{
		  int streets = atoi(argv[2]);
		  int henb = atoi(argv[3]);
		  int reuse = atoi(argv[4]);
		  TestSinrUrban (streets, henb, reuse);
		}
	  if (strcmp(argv[1], "test-throughput-urban")==0)
		{
		  int streets = atoi(argv[2]);
		  int henb = atoi(argv[3]);
		  int reuse = atoi(argv[4]);
		  int nbUEs = atoi(argv[5]);
		  double activityFactor = atoi(argv[6]);
		  TestThroughputUrban (streets, henb, reuse, nbUEs, activityFactor);
		}
	  if (strcmp(argv[1], "test-throughput-macro-with-femto")==0)
		{
		  double radius = atof(argv[2]);
		  int nbBuildings = atoi(argv[3]);
		  int nbUE_macro = atoi(argv[4]);
		  TestThroughputMacroWithFemto (radius, nbBuildings, nbUE_macro);
		}
	  if (strcmp(argv[1], "test-sinr-femto")==0)
		{
		  double riuso = atof(argv[2]);
		  double activityFactor = atof(argv[3]);
		  TestSinrFemto (riuso, activityFactor);
		}

	  if (strcmp(argv[1], "test-throughput-building")==0)
		{
		  double riuso = atof(argv[2]);
		  double activityFactor = atof(argv[3]);
		  int nbUE_femto = atof(argv[4]);
		  TestThroughputBuilding (riuso, activityFactor, nbUE_femto);
		}
	  if (strcmp(argv[1], "MultiCellSinrPlot")==0)
	    {
		  int nbCells = atoi(argv[2]);
		  double radius = atof(argv[3]);
		  int nbUE = atoi(argv[4]);
		  int sched_type = atoi(argv[5]);
		  int frame_struct = atoi(argv[6]);
		  int speed = atoi(argv[7]);
		  int model = atoi(argv[8]);
		  int seed;
		  if (argc==14) seed = atoi(argv[13]);
		  else seed = -1;
		  MultiCellSinrPlot (nbCells, radius, nbUE, sched_type, frame_struct, speed, model, seed);
	    }
	  if (strcmp(argv[1], "testfme")==0)
	    {
		  TestUplinkFME ();
	    }

    }
}
예제 #18
0
HessenbergSchurInfo
MultiBulge
( Matrix<F>& H,
  Matrix<Complex<Base<F>>>& w,
  Matrix<F>& Z,
  const HessenbergSchurCtrl& ctrl )
{
    DEBUG_CSE 
    typedef Base<F> Real;
    const Real zero(0);

    const Int n = H.Height();
    Int winBeg = ( ctrl.winBeg==END ? n : ctrl.winBeg );
    Int winEnd = ( ctrl.winEnd==END ? n : ctrl.winEnd );
    const Int winSize = winEnd - winBeg;
    const Int minMultiBulgeSize = Max( ctrl.minMultiBulgeSize, 4 );
    HessenbergSchurInfo info;

    if( winSize < minMultiBulgeSize )
    {
        return Simple( H, w, Z, ctrl );
    }

    w.Resize( n, 1 );
    Matrix<F> U, W, WAccum;

    auto ctrlShifts( ctrl );
    ctrlShifts.winBeg = 0;
    ctrlShifts.winEnd = END;
    ctrlShifts.fullTriangle = false;

    Int numIterSinceDeflation = 0;
    const Int numStaleIterBeforeExceptional = 5;
    // Cf. LAPACK's DLAQR0 for this choice
    const Int maxIter =
      Max(30,2*numStaleIterBeforeExceptional) * Max(10,winSize);

    Int iterBegLast=-1, winEndLast=-1;
    while( winBeg < winEnd )
    {
        if( info.numIterations >= maxIter )
        {
            if( ctrl.demandConverged )
                RuntimeError("MultiBulge QR iteration did not converge");
            else
                break;
        }
        auto winInd = IR(winBeg,winEnd);

        // Detect an irreducible Hessenberg window, [iterBeg,winEnd)
        // ---------------------------------------------------------
        const Int iterOffset = DetectSmallSubdiagonal( H(winInd,winInd) );
        const Int iterBeg = winBeg + iterOffset;
        const Int iterWinSize = winEnd-iterBeg;
        if( iterOffset > 0 )
            H(iterBeg,iterBeg-1) = zero;
        if( iterWinSize == 1 )
        {
            w(iterBeg) = H(iterBeg,iterBeg);
            --winEnd;
            numIterSinceDeflation = 0;
            continue;
        }
        else if( iterWinSize == 2 )
        {
            multibulge::TwoByTwo( H, w, Z, iterBeg, ctrl );
            winEnd -= 2;
            numIterSinceDeflation = 0;
            continue;
        }
        else if( iterWinSize < minMultiBulgeSize )
        {
            // The window is small enough to switch to the simple scheme
            auto ctrlSub( ctrl );
            ctrlSub.winBeg = iterBeg;
            ctrlSub.winEnd = winEnd;
            Simple( H, w, Z, ctrlSub );
            winEnd = iterBeg;
            continue;
        }

        const Int numShiftsRec = ctrl.numShifts( n, iterWinSize );
        if( ctrl.progress )
        {
            Output("Iter. ",info.numIterations,": ");
            Output("  window is [",iterBeg,",",winEnd,")");
            Output("  recommending ",numShiftsRec," shifts");
        }

        const Int shiftBeg = multibulge::ComputeShifts
        ( H, w, iterBeg, winBeg, winEnd, numShiftsRec, numIterSinceDeflation,
          numStaleIterBeforeExceptional, ctrlShifts );
        auto shiftInd = IR(shiftBeg,winEnd);
        auto wShifts = w(shiftInd,ALL);

        // Perform a small-bulge sweep
        auto ctrlSweep( ctrl );
        ctrlSweep.winBeg = iterBeg;
        ctrlSweep.winEnd = winEnd;
        multibulge::Sweep( H, wShifts, Z, U, W, WAccum, ctrlSweep );

        ++info.numIterations;
        if( iterBeg == iterBegLast && winEnd == winEndLast )
            ++numIterSinceDeflation;
        iterBegLast = iterBeg;
        winEndLast = winEnd;
    }
    info.numUnconverged = winEnd-winBeg;
    return info;
}
예제 #19
0
파일: dir.c 프로젝트: taysom/tau
void DirTest (void)
{
	Simple();
	TreeTest();
//  SeekTest();
}
예제 #20
0
파일: simplest.cpp 프로젝트: ivandzen/HSDB
Void simplest::Simple::init()  {
    setFirstFreeSimple(Simple());
    setNumFreeSimples(0);
    setUsed(0);
    reallocInstances(INITIAL_OBJECT_RESERVE);
}
예제 #21
0
void CHelloTraceFn::OutputsParams(TInt aParam, TFnEnum aEnumParam)
{
    OstTraceFunctionEntryExt( CHELLOTRACEFN_OUTPUTSPARAMS_ENTRY, this );
    Simple();
    OstTraceFunctionExit1( CHELLOTRACEFN_OUTPUTSPARAMS_EXIT, this );
}
예제 #22
0
RicoPtr RicoMultiply::Simple(RicoPtr x, RicoPtr y) {
  vRicoPtr v;
  v.push_back(x);
  v.push_back(y);
  return Simple(v);
}
예제 #23
0
파일: simplest.cpp 프로젝트: ivandzen/HSDB
Void simplest::Simple::reset() const  {
    setExists(true);
    setNextSimpleFreeSimple(Simple());
}
예제 #24
0
파일: rw.c 프로젝트: taysom/tau
void RwTest (void)
{
	Simple();
	rdseek();
	wtseek();
}
예제 #25
0
파일: server.cpp 프로젝트: CCJY/ATCD
int
ACE_TMAIN(int argc, ACE_TCHAR *argv[])
{
  try
    {
      const char *location1 = "MyLocation 1";

      LB_server lb_server (argc, argv);

      if (lb_server.start_orb_and_poa () == -1)
        return 1;

      if (lb_server.create_basic_object_group () == -1)
        return 1;

      if (lb_server.create_simple_object_group () == -1)
        return 1;

      Basic *basic_servant1;
      Basic *basic_servant2;

      Simple *simple_servant1;
      Simple *simple_servant2;


      ACE_NEW_RETURN (basic_servant1,
                      Basic (lb_server.get_basic_object_group (),
                             lb_server.load_manager (),
                             lb_server.orb (),
                             1,
                             location1),
                      1);
      PortableServer::ServantBase_var basic_owner_transfer1(basic_servant1);

      ACE_NEW_RETURN (simple_servant1,
                      Simple (lb_server.get_simple_object_group (),
                              lb_server.load_manager (),
                              lb_server.orb (),
                              1,
                              location1),
                      1);
      PortableServer::ServantBase_var simple_owner_transfer1(simple_servant1);

      if (lb_server.register_basic_servant (basic_servant1, location1) == -1)
        {
          (void) lb_server.destroy();
          return 1;
        }

      if (lb_server.register_simple_servant (simple_servant1, location1) == -1)
        {
          (void) lb_server.destroy();
          return 1;
        }

      if (lb_server.remove_basic_member() == -1)
        {
          return 1;
        }

      if (lb_server.remove_simple_member() == -1)
        {
          return 1;
        }

      ACE_NEW_RETURN (basic_servant2,
                      Basic (lb_server.get_basic_object_group (),
                             lb_server.load_manager (),
                             lb_server.orb (),
                             2,
                             location1),
                      1);
      PortableServer::ServantBase_var basic_owner_transfer2(basic_servant2);

      ACE_NEW_RETURN (simple_servant2,
                      Simple (lb_server.get_simple_object_group (),
                              lb_server.load_manager (),
                              lb_server.orb (),
                              2,
                              location1),
                      1);
      PortableServer::ServantBase_var simple_owner_transfer2(simple_servant2);

      if (lb_server.register_basic_servant (basic_servant2, location1) == -1)
        {
          (void) lb_server.destroy();
          return 1;
        }

      if (lb_server.register_simple_servant (simple_servant2, location1) == -1)
        {
          (void) lb_server.destroy();
          return 1;
        }

      if (lb_server.remove_basic_member() == -1)
        {
          return 1;
        }

      if (lb_server.remove_simple_member() == -1)
        {
          return 1;
        }

      //lb_server.orb ()->shutdown (0);

      ACE_DEBUG ((LM_DEBUG, "(%P|%t) server - event loop finished\n"));

      if (lb_server.destroy () == -1)
        return 1;

    }
  catch (const CORBA::Exception& ex)
    {
      ex._tao_print_exception ("lb_server exception");
      return 1;
    }

  return 0;
}
예제 #26
0
static int EndDTD(void *UserData)
{
	Simple("endDTD");
	return 0;
}
예제 #27
0
파일: simplest.cpp 프로젝트: ivandzen/HSDB
simplest::Simple simplest::Simple::getFirstFreeSimple()  {
    return Simple(staticData().FirstFreeSimple);
}
예제 #28
0
static int StartCDATA(void *UserData) 
{
	Simple("startCDATA");
	return 0;
}