当前位置: 首页>>代码示例>>C++>>正文


C++ ControlInformation::getUint方法代码示例

本文整理汇总了C++中ControlInformation::getUint方法的典型用法代码示例。如果您正苦于以下问题:C++ ControlInformation::getUint方法的具体用法?C++ ControlInformation::getUint怎么用?C++ ControlInformation::getUint使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ControlInformation的用法示例。


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

示例1: load

size_t FourSectionDictionary::load(unsigned char *ptr, unsigned char *ptrMax, ProgressListener *listener)
{
    size_t count=0;

    IntermediateListener iListener(listener);
    ControlInformation ci;
    count += ci.load(&ptr[count], ptrMax);

    this->mapping = ci.getUint("mapping");
    this->sizeStrings = ci.getUint("sizeStrings");

    iListener.setRange(0,25);
    iListener.notifyProgress(0, "Dictionary read shared area.");
    delete shared;
    shared = csd::CSD::create(ptr[count]);
    if(shared==NULL){
        shared = new csd::CSD_PFC();
        throw "Could not read shared.";
    }
    count += shared->load(&ptr[count], ptrMax);
    //shared = new csd::CSD_Cache(shared);

    iListener.setRange(25,50);
    iListener.notifyProgress(0, "Dictionary read subjects.");
    delete subjects;
    subjects = csd::CSD::create(ptr[count]);
    if(subjects==NULL){
        subjects = new csd::CSD_PFC();
        throw "Could not read subjects.";
    }
    count += subjects->load(&ptr[count], ptrMax);
    //subjects = new csd::CSD_Cache(subjects);

    iListener.setRange(50,75);
    iListener.notifyProgress(0, "Dictionary read predicates.");
    delete predicates;
    predicates = csd::CSD::create(ptr[count]);
    if(predicates==NULL){
        predicates = new csd::CSD_PFC();
        throw "Could not read predicates.";
    }
    count += predicates->load(&ptr[count], ptrMax);
    predicates = new csd::CSD_Cache2(predicates);

    iListener.setRange(75,100);
    iListener.notifyProgress(0, "Dictionary read objects.");
    delete objects;
    objects = csd::CSD::create(ptr[count]);
    if(objects==NULL){
        objects = new csd::CSD_PFC();
        throw "Could not read objects.";
    }
    count += objects->load(&ptr[count], ptrMax);
    //objects = new csd::CSD_Cache(objects);

    return count;
}
开发者ID:akjoshi,项目名称:hdt-it,代码行数:57,代码来源:FourSectionDictionary.cpp

示例2: load

void PlainTriples::load(std::istream &input, ControlInformation &controlInformation, ProgressListener *listener)
{
	std::string format = controlInformation.getFormat();
	if(format!=getType()) {
		throw std::runtime_error("Trying to read PlainTriples but the data is not PlainTriples");
	}

	//unsigned int numTriples = controlInformation.getUint("numTriples");
	order = (TripleComponentOrder) controlInformation.getUint("order");

	IntermediateListener iListener(listener);

	iListener.setRange(0,33);
	iListener.notifyProgress(0, "PlainTriples loading subjects");
	delete streamX;
	streamX = IntSequence::getArray(input);
	streamX->load(input);

	iListener.setRange(33, 66);
	iListener.notifyProgress(0, "PlainTriples loading predicates");
	delete streamY;
	streamY = IntSequence::getArray(input);
	streamY->load(input);

	iListener.setRange(66, 100);
	iListener.notifyProgress(0, "PlainTriples loading objects");
	delete streamZ;
	streamZ = IntSequence::getArray(input);
    streamZ->load(input);
}
开发者ID:rdmpage,项目名称:hdt-cpp,代码行数:30,代码来源:PlainTriples.cpp

示例3: load

size_t PlainHeader::load(unsigned char *ptr, unsigned char *ptrMax, ProgressListener *listener)
{
    size_t count = 0;

    // Read ControlInformation
    ControlInformation controlInformation;
    count += controlInformation.load(&ptr[count], ptrMax);

	std::string format = controlInformation.getFormat();
	uint32_t headerSize = controlInformation.getUint("length");

	// FIXME: Use format to create custom parser.
	if(format!=HDTVocabulary::HEADER_NTRIPLES) {
		throw "This Header format is not supported";
	}

    string str(&ptr[count], &ptr[count+headerSize]);

    // Convert into a stringstream
    stringstream strstream(str, stringstream::in);
    triples.clear();

    // Parse header
    RDFParserNtriples parser(strstream, NTRIPLES);
    while(parser.hasNext()) {
        TripleString *ts = parser.next();
        triples.push_back(*ts);
    }

    count+=headerSize;

    return count;
}
开发者ID:mavlyutovrus,项目名称:uriencoding,代码行数:33,代码来源:PlainHeader.cpp

示例4: load

void PlainDictionary::load(std::istream & input, ControlInformation &ci, ProgressListener *listener)
{
    std::string line;
    unsigned char region = 1;

    startProcessing();

    std::string format = ci.getFormat();
    if(format!=getType()) {
        throw "Trying to read a PlainDictionary but the data is not PlainDictionary";
    }

    this->mapping = ci.getUint("mapping");
    this->sizeStrings = ci.getUint("sizeStrings");
    unsigned int numElements = ci.getUint("numEntries");
    unsigned int numLine = 0;

    IntermediateListener iListener(listener);
    iListener.setRange(0,25);
    while(region<5 && getline(input, line,'\1')) {
        //std::cout << line << std::endl;
        if(line!="") {
            if (region == 1) { //shared SO
                NOTIFYCOND(&iListener, "Dictionary loading shared area.", numLine, numElements);
                insert(line, SHARED_SUBJECT);
            } else if (region == 2) { //not shared Subjects
                NOTIFYCOND(&iListener, "Dictionary loading subjects.", numLine, numElements);
                insert(line, NOT_SHARED_SUBJECT);
                NOTIFYCOND(&iListener, "Dictionary loading objects.", numLine, numElements);
            } else if (region == 3) { //not shared Objects
                insert(line, NOT_SHARED_OBJECT);
                NOTIFYCOND(&iListener, "Dictionary loading predicates.", numLine, numElements);
            } else if (region == 4) { //predicates
                insert(line, NOT_SHARED_PREDICATE);
            }
        } else {
            region++;
        }

        numLine++;
    }

    // No stopProcessing() Needed. Dictionary already split and sorted in file.
    updateIDs();
}
开发者ID:datagraph,项目名称:hdt-cpp,代码行数:45,代码来源:PlainDictionary.cpp

示例5: load

void CompactTriples::load(std::istream &input, ControlInformation &controlInformation, ProgressListener *listener)
{
	std::string format = controlInformation.getFormat();
	if(format != HDTVocabulary::TRIPLES_TYPE_COMPACT) {
		throw "Trying to read CompactTriples but data is not CompactTriples";
	}

	numTriples = controlInformation.getUint("numTriples");
	order = (TripleComponentOrder) controlInformation.getUint("order");

	IntermediateListener iListener(listener);

	iListener.setRange(0,30);
	iListener.notifyProgress(0, "CompactTriples loading Stream Y");
	delete streamY;
	streamY = IntSequence::getArray(input);
	streamY->load(input);

	iListener.setRange(30,100);
	iListener.notifyProgress(0, "CompactTriples saving Stream Y");
	delete streamZ;
	streamZ = IntSequence::getArray(input);
    streamZ->load(input);
}
开发者ID:mavlyutovrus,项目名称:uriencoding,代码行数:24,代码来源:CompactTriples.cpp


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