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


C++ registerObject函数代码示例

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


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

示例1: registerObject

AIDA::IHistogram3D*
AIDA_ROOT::AIDA_HistogramFactory::createHistogram3D( const std::string& name, const std::string& title, int nBinsX, double lowerEdgeX, double upperEdgeX, int nBinsY, double lowerEdgeY, double upperEdgeY, int nBinsZ, double lowerEdgeZ, double upperEdgeZ, const std::string& options )
{
#ifdef AIDA_ROOT_HISTOGRAM_NO_EXCEPTIONS_TO_USER
  try{
#endif
  AIDA::Dev::IDevHistogram3D* p = m_factory.createHistogram3D( title, nBinsX, lowerEdgeX, upperEdgeX, nBinsY, lowerEdgeY, upperEdgeY, nBinsZ, lowerEdgeZ, upperEdgeZ, options );
  return registerObject( p, name );
#ifdef AIDA_ROOT_HISTOGRAM_NO_EXCEPTIONS_TO_USER
  }
  catch( std::exception& e ) {
    HISTOGRAM_REPORT_ERROR( e.what() );
    return 0;
  }
#endif
}
开发者ID:apfeiffer1,项目名称:iAIDA,代码行数:16,代码来源:AIDA_HistogramFactory.cpp

示例2: QObject

	Server::Server ()
	: QObject ()
	{
		qInstallMsgHandler (Write);
		const auto pid = QCoreApplication::applicationPid ();

		RegisterTypes ();

		auto sb = QDBusConnection::sessionBus ();
		const auto& serviceName = QString ("org.LeechCraft.Wrapper_%1").arg (pid);
		qDebug () << "registering service..." << sb.registerService (serviceName);
		qDebug () << "registering primary object..." << sb.registerObject ("/org/LeechCraft/Control",
				this, QDBusConnection::ExportAllContents);

		QLocalSocket socket;
		socket.connectToServer (QString ("lc_waiter_%1").arg (pid));
		qDebug () << "notifying master..." << socket.waitForConnected ();
	}
开发者ID:ROOAARR,项目名称:leechcraft,代码行数:18,代码来源:server.cpp

示例3: IOobject

Foam::regIOobject::regIOobject
(
    const IOobject& io,
    const regIOobject& rio
)
:
    IOobject(io),
    registered_(false),
    ownedByRegistry_(false),
    watchIndex_(-1),
    eventNo_(db().getEvent()),
    isPtr_(NULL)
{
    if (registerObject())
    {
        checkIn();
    }
}
开发者ID:Kiiree,项目名称:OpenFOAM-dev,代码行数:18,代码来源:regIOobject.C

示例4: findObject

AudioOutputPort *AudioOutputPortCache::getAudioOutputPort(const char* portName, const char* connection)
{
    int key = std::hash<std::string>()(portName);
    // see if port already exists in map
    AudioOutputPort *port = findObject(key);
    if(!port) {
        // create system port
        jack_port_t *jackPort = AudioEngine::instance().registerAudioOutputPort(portName);
        if(!jackPort) {
            throw std::logic_error(std::string("Failed to register port ") + portName);
        }
        port = new AudioOutputPort(jackPort);
        registerObject(key, port);
    }
    if(connection) {
        port->systemConnect(connection);
    }
    return port;
}
开发者ID:bipscript,项目名称:bipscript,代码行数:19,代码来源:audioport.cpp

示例5: checkOut

// Assign to IOobject
void Foam::regIOobject::operator=(const IOobject& io)
{
    if (isPtr_)
    {
        delete isPtr_;
        isPtr_ = NULL;
    }

    // Check out of objectRegistry
    checkOut();

    IOobject::operator=(io);

    if (registerObject())
    {
        // Re-register object with objectRegistry
        checkIn();
    }
}
开发者ID:Kiiree,项目名称:OpenFOAM-dev,代码行数:20,代码来源:regIOobject.C

示例6: AkLoggerLog

void AkVCam::PluginInterface::destroyDevice(const std::string &deviceId)
{
    AkLoggerLog("AkVCam::PluginInterface::destroyDevice");

    for (auto it = this->m_devices.begin(); it != this->m_devices.end(); it++) {
        auto device = *it;

        std::string curDeviceId;
        device->properties().getProperty(kCMIODevicePropertyDeviceUID,
                                         &curDeviceId);

        if (curDeviceId == deviceId) {
            device->stopStreams();
            device->registerObject(false);
            device->registerStreams(false);
            this->m_devices.erase(it);

            break;
        }
    }
}
开发者ID:webcamoid,项目名称:webcamoid,代码行数:21,代码来源:plugininterface.cpp

示例7: main

int main(int argc, char *argv[])
{
    QApplication a(argc, argv);
    a.setOrganizationName("kylin");
    a.setApplicationName("Kylin Weather (indication-china-weather)");
    a.setApplicationVersion("3.0.1");
    a.setQuitOnLastWindowClosed(false);//Avoid that after hiding mainwindow, close the sub window would cause the program exit

    QString locale = QLocale::system().name();
    QTranslator translator;
    if(locale == "zh_CN") {
        if(!translator.load("indicator-china-weather_" + locale + ".qm",
                            ":/qm/translation/"))
            qDebug() << "Load translation file:"<< "indicator-china-weather_" + locale + ".qm" << " failed!";
        else
            a.installTranslator(&translator);
    }

//    QTranslator qtTranslator;
//    qtTranslator.load("qt_" + locale, QLibraryInfo::location(QLibraryInfo::TranslationsPath));
//    a.installTranslator(&qtTranslator);

    MainWindow w;
    DbusAdaptor adaptor(&w);
    Q_UNUSED(adaptor);
    auto connection = QDBusConnection::sessionBus();
    if (!connection.registerService("com.kylin.weather") || !connection.registerObject("/com/kylin/weather", &w/*, QDBusConnection::ExportAllSlots | QDBusConnection::ExportAllSignals*/)) {
        //qCritical() << "QDbus register service failed reason:" << connection.lastError();
        QDBusInterface iface("com.kylin.weather",
                                       "/com/kylin/weather",
                                       "com.kylin.weather",
                                       connection);
        iface.call("showMainWindow");

        return 0;
    }//QDBusConnection::sessionBus().unregisterService("com.kylin.weather");
    //w.show();

    return a.exec();
}
开发者ID:UbuntuKylin,项目名称:indicator-china-weather,代码行数:40,代码来源:main.cpp

示例8: LBASSERT

bool MasterConfig::init()
{
    LBASSERT( !_objects );
    _objects = new ObjectMap( *this, *getApplication( ));

    co::Object* initData = getInitData();
    if( initData )
        LBCHECK( _objects->register_( initData, OBJECTTYPE_INITDATA ));
    _objects->setInitData( initData );

    LBCHECK( registerObject( _objects ));

    if( !eq::Config::init( _objects->getID( )))
    {
        LBWARN << "Error during initialization" << std::endl;
        exit();
        return false;
    }

    _redraw = true;
    return true;
}
开发者ID:Angels-group,项目名称:Equalizer,代码行数:22,代码来源:masterConfig.cpp

示例9: mainMenu

int mainMenu(void)
{
   int option = -1;

   //system("clear");

   printf("Welcome\n");
   printf("1. Register\n");
   printf("2. Unregister\n");
   printf("3. Query\n");
   printf("4. Exit\n");
   printf("\nOption: ");
   scanf("%d", &option);

   switch (option)
   {
      case 1:
         registerObject();
         break;
      case 2:
         unregisterObject();
         break;
      case 3:
         query();
         break;
      case 4:
         printf("All done!\n");
         break;
      default:
         // no point printing message; system("clear") will erase it.
         //printf("Enter a valid Option, 1 - 4");

         // this will flush the input stream
         while (getchar() != '\n');
         break;
   }

   return option;
}
开发者ID:DANGBI,项目名称:labs,代码行数:39,代码来源:lab53_menu.c

示例10: main

int main(int argc, char *argv[])
{
    QCoreApplication a(argc, argv);

    auto props = new PropertiesServer(&a);
    new PropertiesAdaptor(props);
    new AccountsUserAdaptor(props);

    auto accounts = new AccountsServer(props, &a);
    new AccountsAdaptor(accounts);
    new SecurityPrivacyAdaptor(accounts);
    new LocationAdaptor(accounts);
    new AccountsPrivateAdaptor(accounts);
    // We use the session bus for testing.  The real plugin uses the system bus
    auto connection = QDBusConnection::sessionBus();
    if (!connection.registerObject("/org/freedesktop/Accounts", accounts))
        return 1;
    if (!connection.registerService("org.freedesktop.Accounts"))
        return 1;

    return a.exec();
}
开发者ID:jonjahren,项目名称:unity8,代码行数:22,代码来源:server.cpp

示例11: m_engine

ScriptEngine::ScriptEngine()
	: m_engine(asCreateScriptEngine())
{
	if (!m_engine)
		return;

	// Set the message callback to receive information on errors in human readable form.
	int r = m_engine->SetMessageCallback(asFUNCTION(MessageCallback), &m_errorString, asCALL_CDECL); assert(r >= 0);

	RegisterStdString(m_engine);
	//	RegisterStdStringUtils(engine);

	// The scripts can directly print text
	r = m_engine->RegisterGlobalFunction("void print(const string &in message)", asMETHOD(ScriptEngine, print), asCALL_THISCALL_ASGLOBAL, this); assert(r >= 0);

	RegisterScriptMath(m_engine);
	aatc::RegisterAllContainers(m_engine);
	
	registerObject(m_engine);
	registerAllTypes(m_engine);
	
	generateReference();
}
开发者ID:cguebert,项目名称:Panda,代码行数:23,代码来源:ScriptEngine.cpp

示例12: debugsupport_registerMonitorCommand

void debugsupport_registerMonitorCommand(ObjectDesc * self, ObjectDesc * name, ObjectDesc * cmd)
{
#if defined(MONITOR)
#if defined(JAVA_MONITOR_COMMANDS)
	char value[128];
	Proxy *proxy;
	u4_t quota = 1000;
	DomainDesc *domain = CALLERDOMAIN;
	if (name == 0 || cmd == 0)
		return;
	stringToChar(name, value, sizeof(value));

	DISABLE_IRQ;
#ifdef COPY_TO_DOMAINZERO
	proxy = cmd;
#else
	proxy = copy_reference(domain, curdom(), cmd, &quota);
#endif
	RESTORE_IRQ;

	register_command(value, registerObject(curdom(), proxy), domain);
#endif
#endif				/* MONITOR */
}
开发者ID:BackupTheBerlios,项目名称:jem-svn,代码行数:24,代码来源:zero_DebugSupport.c

示例13: setParent

BattleScripting::BattleScripting(QScriptEngine *engine, BaseBattleWindowInterface *_interface)
{
    myinterface = _interface;
    myengine = engine;
    myengine->setParent(this);
    setParent(_interface);

    registerObject(ProxyDataContainer);
    registerObject(TeamProxy);
    registerObject(PokeProxy);
    registerObject(MoveProxy);
    registerObject(AuxPokeDataProxy);
    registerObject(FieldProxy);
    qScriptRegisterMetaType<BattleChoice>(engine, &toBattleChoice, &fromBattleChoice);

    advbattledata_proxy *data = _interface->getBattleData();
    ProxyDataContainer *pdata = data->exposedData();
    int me = data->isPlayer(1) ? 1 : 0;
    int opp = !me;

    QScriptValue battle = myengine->newQObject(_interface);
    myengine->globalObject().setProperty("battle", battle);
    battle.setProperty("data", myengine->newQObject(dynamic_cast<QObject*>(pdata)));
    battle.setProperty("me", QScriptValue(me));
    battle.setProperty("opp", QScriptValue(opp));
    battle.setProperty("id", _interface->battleId());

    /* Removes clientscripting' print function and add ours. Client scripting's print function
      can still be accessed with sys.print() */
    QScriptValue printfun = myengine->newFunction(nativePrint);
    printfun.setData(myengine->newQObject(this));
    myengine->globalObject().setProperty("print", myengine->nullValue());
    myengine->globalObject().setProperty("print", printfun);

    _interface->addOutput(this);
}
开发者ID:Angryn00b,项目名称:pokemon-online,代码行数:36,代码来源:battlescripting.cpp

示例14: registerObject

 InputObject::InputObject()
 {
   registerObject(this) ;
 }
开发者ID:BackupTheBerlios,项目名称:projet-univers-svn,代码行数:4,代码来源:input_object.cpp

示例15: parent

QString Uic::createObjectImpl( const QDomElement &e, const QString& parentClass, const QString& par, const QString& layout )
{
    QString parent( par );
    if ( parent == "this" && isMainWindow ) {
	if ( !createdCentralWidget )
	    out << indent << "setCentralWidget( new QWidget( this, \"qt_central_widget\" ) );" << endl;
	createdCentralWidget = TRUE;
	parent = "centralWidget()";
    }
    QDomElement n;
    QString objClass, objName;
    int numItems = 0;
    int numColumns = 0;
    int numRows = 0;

    if ( layouts.contains( e.tagName() ) )
	return createLayoutImpl( e, parentClass, parent, layout );

    objClass = getClassName( e );
    if ( objClass.isEmpty() )
	return objName;
    objName = getObjectName( e );

    QString definedName = objName;
    bool isTmpObject = objName.isEmpty() || objClass == "QLayoutWidget";
    if ( isTmpObject ) {
	if ( objClass[0] == 'Q' )
	    objName = objClass.mid(1);
	else
	    objName = objClass.lower();
	objName.prepend( "private" );
    }

    bool isLine = objClass == "Line";
    if ( isLine )
	objClass = "QFrame";

    out << endl;
    if ( objClass == "QLayoutWidget" ) {
	if ( layout.isEmpty() ) {
	    // register the object and unify its name
	    objName = registerObject( objName );
	    out << "    QWidget* " << objName << " = new QWidget( " << parent << ", \"" << definedName << "\" );" << endl;
	} else {
	    // the layout widget is not necessary, hide it by creating its child in the parent
	    QString result;
	    for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) {
		if (tags.contains( n.tagName() ) )
		    result = createObjectImpl( n, parentClass, parent, layout );
	    }
	    return result;
	}
    } else if ( objClass != "QToolBar" && objClass != "QMenuBar" ) {
	// register the object and unify its name
	objName = registerObject( objName );
	out << "    ";
	if ( isTmpObject )
	    out << objClass << "* ";
	out << objName << " = new " << createObjectInstance( objClass, parent, objName ) << ";" << endl;
    }

    if ( objClass == "QAxWidget" ) {
	QString controlId;
	for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) {
	    if ( n.tagName() == "property" && n.attribute( "name" ) == "control" ) {
		controlId = n.firstChild().toElement().text();
	    }
	}
	out << "    ";
	out << objName << "->setControl(\"" << controlId << "\");" << endl;
    }

    lastItem = "0";
    // set the properties and insert items
    bool hadFrameShadow = FALSE;
    for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) {
	if ( n.tagName() == "property" ) {
	    bool stdset = stdsetdef;
	    if ( n.hasAttribute( "stdset" ) )
		stdset = toBool( n.attribute( "stdset" ) );
	    QString prop = n.attribute( "name" );
	    if ( prop == "database" )
		continue;
	    QString value = setObjectProperty( objClass, objName, prop, n.firstChild().toElement(), stdset );
	    if ( value.isEmpty() )
		continue;
	    if ( prop == "name" )
		continue;
	    if ( isLine && prop == "frameShadow" )
		hadFrameShadow = TRUE;
	    if ( prop == "buddy" && value.startsWith("\"") && value.endsWith("\"") ) {
		buddies << Buddy( objName, value.mid(1, value.length() - 2 ) );
		continue;
	    }
	    if ( isLine && prop == "orientation" ) {
		prop = "frameShape";
		if ( value.right(10) == "Horizontal" )
		    value = "QFrame::HLine";
		else
		    value = "QFrame::VLine";
//.........这里部分代码省略.........
开发者ID:AliYousuf,项目名称:univ-aca-mips,代码行数:101,代码来源:object.cpp


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