BaseConnection::BaseConnection(const sockets::SocketFd& fd, ServerSPtr& handler) : is_persistent_(false) , buffer_length_(1500) , buffer_(buffer_length_) , handler_(handler) , logger_(log4cpp::Category::getInstance("webserver")) { SetDescriptor(fd); SetOptions_(); }
static int NewSuperUserDescriptor( uint32 baseAddress, uint32 granularySize, int type ){ int freeDescriptorId = GetFreeUserDescriptorId(); if( ! freeDescriptorId ){ return 0; } int flag = (type==CODE)? (GDT_CODE_PL0) : (GDT_DATA_PL0); SetDescriptor( freeDescriptorId, baseAddress, granularySize, flag ); return freeDescriptorId<<3 | (0<<2) | 0 ; }
Comparator::Comparator( char *descritor ) { // // Construtor que recebe descritor. // SetDescriptor( descritor ); return; }
void DeprecatedTextureClientShmemYCbCr::SetDescriptorFromReply(const SurfaceDescriptor& aDescriptor) { MOZ_ASSERT(aDescriptor.type() == SurfaceDescriptor::TYCbCrImage); DeprecatedSharedPlanarYCbCrImage* shYCbCr = DeprecatedSharedPlanarYCbCrImage::FromSurfaceDescriptor(aDescriptor); if (shYCbCr) { shYCbCr->Release(); mDescriptor = SurfaceDescriptor(); } else { SetDescriptor(aDescriptor); } }
ProcessInfo::ProcessInfo(GameProcess *process) { ASSERT(process != NULL); this->process = process; name = ""; isTransitioning = false; isTransitioningOut = false; isTransitionStarting = false; isInactive = false; isBeingRemoved = false; SetDescriptor(); }
ProcessInfo::ProcessInfo(GameProcess *process, const stl::string &name) { ASSERT(process != NULL); this->process = process; this->name = name; isTransitioning = false; isTransitioningOut = false; isTransitionStarting = false; isInactive = false; isBeingRemoved = false; SetDescriptor(); }
void ttt::AJSegmentationDijkstraFilter<TInputAJGraph,TPlatenessImage, TVertexnessImage,TOutputAJGraph>::InitDefGraph() { typename OutputAJGraphType::Pointer outputajgraph = this->GetOutput(); typename InputAJGraphType::ConstPointer inputajgraph = this->GetInputAJGraph(); for (auto ajvertexIt = inputajgraph->VerticesBegin(); ajvertexIt != inputajgraph->VerticesEnd(); ++ajvertexIt) { auto inputAJVertex = inputajgraph->GetAJVertex(*ajvertexIt); auto outputAJVertex = OutputAJGraphType::AJVertexType::New(); outputAJVertex->SetPosition(inputAJVertex->GetPosition()); outputAJVertex->SetDescriptor(inputAJVertex->GetDescriptor()); outputajgraph->AddAJVertex(outputAJVertex); } }
BaseConnection::BaseConnection(const std::string& local, sockets::SocketAddress& remote, ServerSPtr& handler) : is_persistent_(false) , buffer_length_(1500) , buffer_(buffer_length_) , handler_(handler) , logger_(log4cpp::Category::getInstance("webserver")) { sockets::SocketFd fd; if (!fd.Open() || !fd.SetReuseAddress(true)) { base_throw(IOException, "Could not allocate socket for communication"); } if (!local.empty() && !fd.Bind(local)) { base_throw(IOException, "Could not bind socket to address"); } SetDescriptor(fd); SetOptions_(); if (!fd.Connect(remote)) { if (errno != EINPROGRESS) { fd.Close(); base_throw(IOException, "Could not connect to remote peer"); } fd_set rset, wset; timeval tv; FD_ZERO(&rset); FD_ZERO(&wset); FD_SET(Descriptor().Descriptor(), &rset); FD_SET(Descriptor().Descriptor(), &wset); tv.tv_sec = handler_->GetConnectionTimeout(); tv.tv_usec = 0; if (::select(fd.Descriptor() + 1, &rset, &wset, 0, &tv) == 0) { Descriptor().Close(); base_throw(IOException, "Connection timed out"); } } }
std::vector<GDALFeaturePoint>* GDALSimpleSURF::ExtractFeaturePoints( GDALIntegralImage *poImg, double dfThreshold ) { std::vector<GDALFeaturePoint>* poCollection = new std::vector<GDALFeaturePoint>(); // Calc Hessian values for layers. poOctMap->ComputeMap(poImg); // Search for extremum points. for( int oct = octaveStart; oct <= octaveEnd; oct++ ) { for( int k = 0; k < GDALOctaveMap::INTERVALS - 2; k++ ) { GDALOctaveLayer *bot = poOctMap->pMap[oct - 1][k]; GDALOctaveLayer *mid = poOctMap->pMap[oct - 1][k + 1]; GDALOctaveLayer *top = poOctMap->pMap[oct - 1][k + 2]; for( int i = 0; i < mid->height; i++ ) { for( int j = 0; j < mid->width; j++ ) { if( poOctMap->PointIsExtremum(i, j, bot, mid, top, dfThreshold) ) { GDALFeaturePoint oFP(j, i, mid->scale, mid->radius, mid->signs[i][j]); SetDescriptor(&oFP, poImg); poCollection->push_back(oFP); } } } } } return poCollection; }
AUI_ERRCODE aui_Font::InitCommon( MBCHAR *descriptor ) { m_hfont = NULL; m_height = 0; m_averageWidth = 0; m_escapement = 0; m_orientation = 0; m_weight = 0; m_italic = 0; m_underline = 0; m_strikeout = 0; m_charset = 0; m_outputPrecision = 0; m_clipPrecision = 0; m_quality = 0; m_pitchAndFamily = 0; AUI_ERRCODE errcode = SetDescriptor( descriptor ); Assert( AUI_SUCCESS(errcode) ); if ( !AUI_SUCCESS(errcode) ) return errcode; return AUI_ERRCODE_OK; }
int main(int argc, char **argv) { struct rwcdb dbh; /* database handle */ int rc, i, open = 0; char dbfile[PATH_MAX], realroot[PATH_MAX], prefix[PATH_MAX]; char *lkdbdir, *lkdbfile; char *tmp, *d, *r; int dirs = 0; /* Parse args */ for (i = 1; i < argc; i++) { if (!strcmp(argv[i], "-v")) {VerboseFlag = 1; continue;} if (!strcmp(argv[i], "-r")) {RelativePathFlag = 1; continue;} if (*(argv[i]) == '-') goto ParseError; /* no other flags meaningful */ if (!NewLKDB) {NewLKDB = argv[i]; continue;} if (!TreeRoot) {TreeRoot = argv[i]; continue;} goto ParseError; } if (!NewLKDB || !TreeRoot) goto ParseError; /* get absolute path to the lka database we want to create */ tmp = strrchr(NewLKDB, '/'); if (!tmp) { lkdbdir = "."; lkdbfile = NewLKDB; } else { *tmp = '\0'; lkdbdir = NewLKDB; lkdbfile = tmp + 1; } tmp = realpath(lkdbdir, dbfile); if (!tmp) { printf("realpath(%s): %s\n", lkdbfile, strerror(errno)); goto err; } strcat(dbfile, "/"); strcat(dbfile, lkdbfile); /* get absolute path to the subtree we want to index */ tmp = realpath(TreeRoot, realroot); if (!tmp) { printf("realpath(%s): %s\n", TreeRoot, strerror(errno)); goto err; } if (RelativePathFlag) { /* find the relative path we need to get from lka file to the * indexed files */ d = dbfile; r = realroot; while (*d == *r) { d++; r++; }; /* ignore common prefix */ while (*d != '/') { d--; r--; } d++; r++; /* backtrack to last dir */ /* create '../' entries for remaining directories in the db path */ while ((d = strchr(d, '/'))) { strcpy(&prefix[dirs * 3], "../"); dirs++; d++; } strcpy(&prefix[dirs * 3], r); /* append remaining directories */ } /* Create lookaside database */ rc = rwcdb_init(&dbh, dbfile, O_CREAT | O_RDWR); if (rc) { printf("%s: %s\n", dbfile, strerror(errno)); goto err; } open = 1; /* Insert the descriptor record */ if (SetDescriptor(&dbh)) /* error */ goto err; /* Walk the tree at TreeRoot, inserting records for each file */ if (WalkTree(realroot, prefix, &dbh) < 0) /* error */ goto err; /* DBFillComplete */ rwcdb_free(&dbh); return(0); ParseError: printf("Usage: mklka [-v] [-r] <newlkdb.lka> <treeroot>\n"); err: if (open) rwcdb_free(&dbh); return(-1); }
void FontFace::SetDisplay(const nsAString& aValue, ErrorResult& aRv) { mFontFaceSet->FlushUserFontSet(); SetDescriptor(eCSSFontDesc_Display, aValue, aRv); }
void FontFace::SetFeatureSettings(const nsAString& aValue, ErrorResult& aRv) { mFontFaceSet->FlushUserFontSet(); SetDescriptor(eCSSFontDesc_FontFeatureSettings, aValue, aRv); }
void FontFace::SetUnicodeRange(const nsAString& aValue, ErrorResult& aRv) { mFontFaceSet->FlushUserFontSet(); SetDescriptor(eCSSFontDesc_UnicodeRange, aValue, aRv); }
void CTestStepActrl::SetReadDescriptor( TPtr8* aDescriptor ) { // The read descriptor's length will be correctly set by RFile::Read(). iDescConfigRead = SetDescriptor(aDescriptor); }
static void AddDescriptor(uint32 base, uint32 limit, uint16 flag){ SetDescriptor(GDTR.size++, base, limit, flag); }
void CTestStepActrl::SetWriteDescriptor( TPtr8* aDescriptor ) { // Must explicitly set the write descriptor's length to zero. aDescriptor->Zero(); iDescConfigWrite = SetDescriptor(aDescriptor); }