• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ setConfig函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: lazy

Field::Field(const TCHAR* Name, const TCHAR* Value, int _config, const bool duplicateValue):
	lazy(false)
{
	CND_PRECONDITION(Name != NULL, "Name cannot be NULL");
	CND_PRECONDITION(Value != NULL, "value cannot be NULL");
	CND_PRECONDITION(_tcslen(Value)>0 && _tcslen(Name)>0, "name and value cannot both be empty");

	/*
	if (_config & INDEX_NO && _config & STORE_NO)
		_CLTHROWA(CL_ERR_IllegalArgument,"it doesn't make sense to have a field that is neither indexed nor stored");
	if (_config & INDEX_NO && _config & TERMVECTOR_YES)
		_CLTHROWA(CL_ERR_IllegalArgument,"cannot store term vector information for a field that is not indexed");
	*/

	_name        = CLStringIntern::intern( Name );
	if (duplicateValue)
		fieldsData = stringDuplicate( Value );
	else
		fieldsData = (void*)Value;
	valueType = VALUE_STRING;

	boost=1.0f;

	//config = INDEX_TOKENIZED; // default Field is tokenized and indexed

	setConfig(_config);
}
开发者ID:Beirdo,项目名称:beirdobot,代码行数:27,代码来源:Field.cpp


示例2: printf

/*--------------------------------------------------------------------------*/
void engine::start ( int argc , char **argv,bool sg){
  int P,p,q;

  config.getCmdLine(argc,argv);
  P =config.P;
  p =config.p;
  q =config.q;
  time_out = config.to;
  printf("Engine start, pure-mpi=%d\n",config.pure_mpi);

  ProcessGrid *_PG = new ProcessGrid(P,p,q);
  ProcessGrid &PG=*_PG;

  DataHostPolicy      *hpData    = new DataHostPolicy    (DataHostPolicy::BLOCK_CYCLIC         , PG );
  TaskHostPolicy      *hpTask    = new TaskHostPolicy    (TaskHostPolicy::WRITE_DATA_OWNER     , PG );
  ContextHostPolicy   *hpContext = new ContextHostPolicy (ContextHostPolicy::ALL_ENTER         , PG );
  TaskReadPolicy      *hpTaskRead= new TaskReadPolicy    (TaskReadPolicy::ALL_READ_ALL         , PG );
  TaskAddPolicy       *hpTaskAdd = new TaskAddPolicy     (TaskAddPolicy::WRITE_DATA_OWNER      , PG );


  glbCtx.setPolicies(hpData,hpTask,hpContext,hpTaskRead,hpTaskAdd);
  glbCtx.setConfiguration(&config);
  if ( config.pure_mpi )
    sg = true;
  else
    sg= false;
  setConfig(&config,sg);
  doProcess();
}
开发者ID:afshin-zafari,项目名称:DuctTeip,代码行数:30,代码来源:engine.cpp


示例3: qCCritical

bool EglHwcomposerBackend::initBufferConfigs()
{
    const EGLint config_attribs[] = {
        EGL_RED_SIZE,             8,
        EGL_GREEN_SIZE,           8,
        EGL_BLUE_SIZE,            8,
        EGL_ALPHA_SIZE,           8,
        EGL_RENDERABLE_TYPE,      EGL_OPENGL_ES2_BIT,
        EGL_NONE,
    };

    EGLint count;
    EGLConfig configs[1024];
    if (eglChooseConfig(eglDisplay(), config_attribs, configs, 1, &count) == EGL_FALSE) {
        qCCritical(KWIN_HWCOMPOSER) << "choose config failed";
        return false;
    }
    if (count != 1) {
        qCCritical(KWIN_HWCOMPOSER) << "choose config did not return a config" << count;
        return false;
    }
    setConfig(configs[0]);

    return true;
}
开发者ID:KDE,项目名称:kwin,代码行数:25,代码来源:egl_hwcomposer_backend.cpp


示例4: if

void ConfigSubscriptions::buttonClicked (Button* buttonThatWasClicked)
{
    //[UserbuttonClicked_Pre]
    //[/UserbuttonClicked_Pre]

    if (buttonThatWasClicked == subscribeButton)
    {
        //[UserButtonCode_subscribeButton] -- add your button handler code here..
        //[/UserButtonCode_subscribeButton]
    }
    else if (buttonThatWasClicked == ignoreButton)
    {
        //[UserButtonCode_ignoreButton] -- add your button handler code here..
        //[/UserButtonCode_ignoreButton]
    }

    //[UserbuttonClicked_Post]

  bool should_subscribe = this->subscribeButton->getToggleState() ;
  bool should_ignore    = this->ignoreButton->getToggleState() ;
  int  subscribe_mode   = (should_ignore)   ? NJClient::SUBSCRIBE_DENY :
                          (should_subscribe)? NJClient::SUBSCRIBE_ALL  :
                                              NJClient::SUBSCRIBE_NONE ;

  setConfig(CONFIG::SUBSCRIBE_MODE_KEY , var(subscribe_mode)) ;

    //[/UserbuttonClicked_Post]
}
开发者ID:FeodorFitsner,项目名称:linjam,代码行数:28,代码来源:ConfigSubscriptions.cpp


示例5: assert

void CBankInstanceConstructor::configureObject(CGObjectInstance * object, CRandomGenerator & rng) const
{
    //logGlobal->debugStream() << "Seed used to configure bank is " << rng.nextInt();

    auto bank = dynamic_cast<CBank*>(object);

    bank->resetDuration = bankResetDuration;

    si32 totalChance = 0;
    for (auto & node : levels)
        totalChance += node["chance"].Float();

    assert(totalChance != 0);

    si32 selectedChance = rng.nextInt(totalChance - 1);
    //logGlobal->debugStream() << "Selected chance for bank config is " << selectedChance;

    for (auto & node : levels)
    {
        if (selectedChance < node["chance"].Float())
        {
            bank->setConfig(generateConfig(node, rng));
        }
        else
        {
            selectedChance -= node["chance"].Float();
        }

    }
}
开发者ID:RoRElessar,项目名称:vcmi,代码行数:30,代码来源:CommonConstructors.cpp


示例6: QObject

MachineConfigObject::MachineConfigObject(QObject *parent, MachineConfig *config)
 : QObject(parent)
    , myConfig(0)
{
    setConfig(config);
    connect(config, SIGNAL(optionChanged(QString, QString, QString, QVariant)),this,SLOT(configChanged(QString, QString, QString, QVariant)));
}
开发者ID:crrodriguez,项目名称:qtemu,代码行数:7,代码来源:machineconfigobject.cpp


示例7: throw

//__________________________________________________________________________
void Speller::Aspell::Suggest::init(const std::string& lang,
				    const std::string& jargon,
				    const std::string& encoding)
	throw( std::invalid_argument, std::runtime_error )
{
	// Save aspell configuration values
	flang = lang;
	fjargon = jargon;
	fencoding = encoding;

	fconfig = new_aspell_config();
	try
	{
		setConfig();
	}
	catch( const std::invalid_argument& err )
	{
		throw err;
	}

	AspellCanHaveError* ret = new_aspell_speller( fconfig );
	delete_aspell_config( fconfig );
	if( aspell_error_number( ret ) != 0 )
	{
		delete_aspell_can_have_error( ret );
		throw std::runtime_error( "(Aspell::Speller::Suggest::init"
					  "): Error in creating speller." );
	}
	else
	{
		fspeller = to_aspell_speller( ret );
		fconfig = aspell_speller_config( fspeller );
	}
}
开发者ID:moceap,项目名称:scribus,代码行数:35,代码来源:suggest.cpp


示例8: onResourceInitialization

      //! Initialize resources.
      void
      onResourceInitialization(void)
      {
        if (!getConstantParameters())
          throw RestartNeeded(DTR("failed to get constant parameters"), c_restart_delay);

        setConfig();

        std::map<std::string, LED*>::iterator itr = m_led_by_name.begin();
        for (unsigned i = 0; i < c_led_count; ++i)
          setBrightness(itr->second, 0);

        if (!m_args.led_patterns.empty())
        {
          uint8_t count = m_args.led_patterns.size();

          UCTK::Frame frame;
          frame.setId(PKT_ID_LED_PATTERN);
          frame.setPayloadSize(1 + (count * 2));
          frame.set(count, 0);
          for (size_t i = 0; i < count; ++i)
            frame.set<uint16_t>(m_args.led_patterns[i], 1 + i * 2);
          if (!m_ctl->sendFrame(frame))
            throw RestartNeeded(DTR("failed to set LED patterns"), c_restart_delay);
        }

        m_wdog.reset();
        setEntityState(IMC::EntityState::ESTA_NORMAL, Status::CODE_ACTIVE);
      }
开发者ID:FreddyFox,项目名称:dune,代码行数:30,代码来源:Task.cpp


示例9: runtimeSetConfiguration

/******************************************************************************
Configures the device by setting it into the configured state.

Parameters:
  cfgnum - configuration number to set
******************************************************************************/
static void runtimeSetConfiguration(uint8_t cfgnum)
{
  // Set & save the desired configuration
  setConfig(cfgnum);
  // Acknowledge the request
  txZLP();
}
开发者ID:femtoio,项目名称:femto-beacon,代码行数:13,代码来源:enumeration.c


示例10: CND_PRECONDITION

Field::Field(const TCHAR* Name, Reader* reader, bool store, bool index, bool token, const bool storeTermVector)
{
//Func - Constructor
//Pre  - Name != NULL and contains the name of the field
//       reader != NULL and contains a Reader
//       store indicates if the field must be stored
//       index indicates if the field must be indexed
//       token indicates if the field must be tokenized
//Post - The instance has been created

    CND_PRECONDITION(Name != NULL, "Name is NULL");
    CND_PRECONDITION(reader != NULL, "reader is NULL");

    _name        = LStringIntern::intern( Name  CL_FILELINE);
    _stringValue = NULL;
    _readerValue = reader;
    _streamValue = NULL;
    boost=1.0f;
    omitNorms = false;

    int cfg = 0;
    if ( store )
        cfg |= STORE_YES;
    if ( index && token )
        cfg |= INDEX_TOKENIZED;
    else if ( index && !token )
        cfg |= INDEX_UNTOKENIZED;

    if ( storeTermVector )
        _CLTHROWA(CL_ERR_IllegalArgument,"Stored term vector is deprecated with using this constructor");

    setConfig(cfg);
}
开发者ID:kuailexs,项目名称:symbiandump-mw3,代码行数:33,代码来源:field.cpp


示例11: Service

RabbitMQService::RabbitMQService (Glib::KeyFile &confFile) : Service (confFile)
{
  sigset_t mask;
  std::string address;
  int port;

  try {
    address = confFile.get_string (RABBITMQ_GROUP, RABBITMQ_SERVER_ADDRESS);
  } catch (const Glib::KeyFileError &err) {
    GST_WARNING ("Setting default address %s to media server",
                 RABBITMQ_SERVER_ADDRESS_DEFAULT);
    address = RABBITMQ_SERVER_ADDRESS_DEFAULT;
  }

  try {
    port = confFile.get_integer (RABBITMQ_GROUP, RABBITMQ_SERVER_PORT);
    check_port (port);
  } catch (const Glib::KeyFileError &err) {
    GST_WARNING ("Setting default port %d to media server",
                 RABBITMQ_SERVER_PORT_DEFAULT);
    port = RABBITMQ_SERVER_PORT_DEFAULT;
  }

  this->address = address;
  this->port = port;

  setConfig (address, port);
  this->confFile.load_from_data (confFile.to_data() );

  sigemptyset (&mask);
  sigaddset (&mask, SIGCHLD);
  signalHandler = std::shared_ptr <SignalHandler> (new SignalHandler (mask,
                  std::bind (&RabbitMQService::childSignal, this, std::placeholders::_1) ) );
}
开发者ID:apismontana,项目名称:kurento-media-server,代码行数:34,代码来源:RabbitMQService.cpp


示例12: setConfig

void Musec::loadLanguage(const QString& lang)
{
    qApp->removeTranslator(fTranslator);
    fTranslator->load(QLocale(lang), "musec", "_", ":/locales");
    setConfig("lang", lang);
    qApp->installTranslator(fTranslator);
}
开发者ID:Mystler,项目名称:Musec,代码行数:7,代码来源:Musec.cpp


示例13: _setName

    MockReplicaSet::MockReplicaSet(const string& setName, size_t nodes):
            _setName(setName) {
        ReplConfigMap replConfig;

        for (size_t n = 0; n < nodes; n++) {
            std::stringstream str;
            str << "$" << setName << n << ":27017";
            const string hostName(str.str());

            if (n == 0) {
                _primaryHost = hostName;
            }

            MockRemoteDBServer* mockServer = new MockRemoteDBServer(hostName);
            _nodeMap[hostName] = mockServer;

            MockConnRegistry::get()->addServer(mockServer);

            ReplSetConfig::MemberCfg config;
            config.h = HostAndPort(hostName);
            replConfig.insert(std::make_pair(hostName, config));
        }

        setConfig(replConfig);
    }
开发者ID:acmorrow,项目名称:mongo-cxx-driver-test,代码行数:25,代码来源:mock_replica_set.cpp


示例14: setup

/**************************************************
* Configure the Pi / touchIt
**************************************************/
void setup()
{
	unsigned char len = 0;
	unsigned char dir = IN;
	static const char dir_str[] = "in\0out";

	signal (SIGINT, exitHandler);

	// Open the I2C bus (enable file access)
	char *filename = (char *)"/dev/i2c-1";
	if((file_i2c = open(filename, O_RDWR)) < 0)
	{
		printf("setup(): Failed to open the i2c bus\n");
		return;
	}

	if(ioctl(file_i2c, I2C_SLAVE, TCHADD1) < 0)
	{
		printf("Failed to acquire bus access and/or talk to slave\n");
		return;
	}

	// Enable GPIO to read touchIt 'int' pin
	if((file_gpio = open("/sys/class/gpio/export", O_WRONLY)) < 0)
	{
		printf("setup(): Failed to open export for writing\n");
		return;
	}
	else
	{
		len = snprintf(buffer, BUFMAX, "%d", intPin);
		write(file_gpio, buffer, len);
		close(file_gpio);
	}

	// Configure GPIO Direction as input
	snprintf(buffer, DIRMAX, "/sys/class/gpio/gpio%d/direction", intPin);
	if((file_gpio = open(buffer, O_WRONLY)) < 0)
	{
		printf("setup(): Failed to open gpio direction for writing\n");
		return;
	}
	else
	{
		write(file_gpio, &dir_str[IN == dir ? 0:3], IN  == dir ? 2:3);
		close(file_gpio);
	}

	// Open gpio file for reading
	snprintf(buffer, DIRMAX, "/sys/class/gpio/gpio%d/value", intPin);
	if((file_gpio = open(buffer, O_RDONLY)) < 0)
	{
		printf("gpioRead(): failed to open gpio value for reading\n");
		return;
	}

	getVersion();

	setConfig(XMOVE | YMOVE);
}
开发者ID:ProBotsUK,项目名称:touchIt,代码行数:63,代码来源:touchIt_GET_POS.c


示例15: cannyHighThresh

ImageProcessor::ImageProcessor(SkinCamConfig aConfig)
	:mouseClickNbhrd(7), cannyHighThresh(127), cannyLowThresh(127), cannyImage(0), medianKernel(7),
	  autoSelectCannyImage(false), lastSharpestBand(0),
	  distLowEnd(aConfig.distanceLowEnd), distHighEnd(aConfig.distanceHighEnd)
{
	setConfig(aConfig);
}
开发者ID:yudanaz,项目名称:masterthesis,代码行数:7,代码来源:imageprocessor.cpp


示例16: IPhysicalInterface

TICC1100::TICC1100(std::shared_ptr<BaseLib::Systems::PhysicalInterfaceSettings> settings) : IPhysicalInterface(GD::bl, settings)
{
	try
	{
		_out.init(GD::bl);
		_out.setPrefix(GD::out.getPrefix() + "TI CC110X \"" + settings->id + "\": ");

		if(settings->listenThreadPriority == -1)
		{
			settings->listenThreadPriority = 45;
			settings->listenThreadPolicy = SCHED_FIFO;
		}
		if(settings->oscillatorFrequency < 0) settings->oscillatorFrequency = 26000000;
		if(settings->txPowerSetting < 0) settings->txPowerSetting = 0xC0;

		_transfer =  { (uint64_t)0, (uint64_t)0, (uint32_t)0, (uint32_t)4000000, (uint16_t)0, (uint8_t)8, (uint8_t)0, (uint32_t)0 };

		setConfig();
	}
    catch(const std::exception& ex)
    {
    	_out.printEx(__FILE__, __LINE__, __PRETTY_FUNCTION__, ex.what());
    }
    catch(BaseLib::Exception& ex)
    {
    	_out.printEx(__FILE__, __LINE__, __PRETTY_FUNCTION__, ex.what());
    }
    catch(...)
    {
    	_out.printEx(__FILE__, __LINE__, __PRETTY_FUNCTION__);
    }
}
开发者ID:skohlmus,项目名称:Homegear,代码行数:32,代码来源:TICC1100.cpp


示例17: KTMainWindow

Kiptables::Kiptables(const char *name,KIptablesConfig *config) : KTMainWindow(name)
{
	setConfig(config);
	initView();
	initActions();
	createGUI();
}
开发者ID:BackupTheBerlios,项目名称:kiptables,代码行数:7,代码来源:kiptables.cpp


示例18: switch

bool CDVRPTRV3Controller::openModem()
{
	bool ret = false;

	switch (m_connection) {
		case CT_USB:
			ret = m_usb->open();
			break;
		case CT_NETWORK:
			ret = m_network->open();
			break;
		default:
			wxLogError(wxT("Invalid connection type: %d"), int(m_connection));
			break;
	}

	if (!ret)
		return false;

	ret = readSerial();
	if (!ret) {
		closeModem();
		return false;
	}

	ret = setConfig();
	if (!ret) {
		closeModem();
		return false;
	}

	return true;
}
开发者ID:EA3HKB,项目名称:OpenDV,代码行数:33,代码来源:DVRPTRV3Controller.cpp


示例19: setConfig

void plDynamicTextMap::Create(unsigned int width, unsigned int height,
                              bool hasAlpha, unsigned int extraWidth,
                              unsigned int extraHeight) {
    setConfig(kRGB8888);
    fVisWidth = width;
    fVisHeight = height;
    fHasAlpha = hasAlpha;
    fWidth = 1;
    if (width + extraWidth > 1) {
        while (fWidth < (width + extraWidth))
            fWidth *= 2;
    }
    fHeight = 1;
    if (height + extraHeight > 1) {
        while (fHeight < (height + extraHeight))
            fHeight *= 2;
    }

    fHasBeenCreated = true;
    /*fFlags |= kDontThrowAwayImage;*/
    fStride = fWidth * 4;
    fLevelData.resize(1);
    fCompressionType = kUncompressed;
    fUncompressedInfo.fType = kRGB8888;
}
开发者ID:GPNMilano,项目名称:libhsplasma,代码行数:25,代码来源:plDynamicTextMap.cpp


示例20: initializeLog

/**
 * Inicializa o mecanismo de log
 */
void initializeLog() {

	// Desabilita o log
	debugEnabled = 0;

	// Obtem recurso para ativar log
	enabledLog = getProperty(PROPERTY_LOG_ENABLED);

	// Verifica se deve ativar o log
	if (enabledLog != NULL && strcmp(enabledLog, "true") == 0) {

		fileLogName = getProperty(PROPERTY_LOG_FILE);
		if (fileLogName == NULL) {
			fileLogName = LOG_FILE;
		}

		// Obtem output
		output = getProperty(PROPERTY_LOG_OUTPUT);

		// Ativa o log
		debugEnabled = 1;

		if (output != NULL) {

			setConfig(atoi(output));

		}

	}

}
开发者ID:antoniomacamps,项目名称:cristianojmiranda,代码行数:34,代码来源:log.c



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ setConnected函数代码示例发布时间:2022-05-30
下一篇:
C++ setCompactProp函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap