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


C++ getService函数代码示例

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


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

示例1: getService

                        void TVDeviceId::deviceRemoved(UPnPDevice* device) {
                            UPnPStateVariable* variable = getService()->getUPnPStateVariable("DevicesIds");

                            string devices = variable->getValue();

                            int line = devices.find(device->getUDN());
                            if (line != string::npos) {
                                string first = devices.substr(0, line);
                                string last = devices.substr(line);

                                int first_pos = first.find_last_of("\n");
                                if ((first_pos == string::npos) || (first_pos == 0)) {
                                    first = "";
                                } else {
                                    first = first.substr(0, first_pos);
                                }

                                int last_pos = last.find("\n");
                                if (last_pos == string::npos) {
                                    last = "";
                                } else {
                                    last = last.substr(last_pos);
                                }

                                devices = first + last;

                                variable->setValue(devices.c_str());
                                Utils::updateLastChangeStateVariable(getService(), variable);
                            }
                        }
开发者ID:lince,项目名称:ginga-hones,代码行数:30,代码来源:TVDeviceId.cpp

示例2: LoggerUtil_info

                        bool TVRConnectionManager::actionGetProtocolInfo(UPnPAction *action) {
                            LoggerUtil_info(logger, "Entrando no método actionGetProtocolInfo(action)!");

                            // Source
                            action->getUPnPArgument(SOURCE)->setValue(getService()->getUPnPStateVariable(SOURCE_PROTOCOL_INFO)->getValue());
                            // Sink
                            action->getUPnPArgument(SINK)->setValue(getService()->getUPnPStateVariable(SINK_PROTOCOL_INFO)->getValue());
                            return true;
                        }
开发者ID:lince,项目名称:ginga-hones,代码行数:9,代码来源:TVRConnectionManager.cpp

示例3: getService

                        void TVRConnectionManager::initializeStateVariables() {
                            ostringstream sinkProtocol;
                            int length = Utils::getDLNAProfilesLength();
                            for (int i = 0; i < length; i++) {
                                if (i > 0)
                                    sinkProtocol << ",";
                                sinkProtocol << "http-get:*:" << Utils::getDLNAProfiles()[i][0] << ":DLNA.ORG_PN=" << Utils::getDLNAProfiles()[i][1];
                            }

                            getService()->getUPnPStateVariable(CURRENT_CONNECTION_IDS)->setValue(""); // "" ou "0"
                            getService()->getUPnPStateVariable(SINK_PROTOCOL_INFO)->setValue(sinkProtocol.str().c_str()); // "http-get:*:*:*,rtsp:*:*:*,http-get:*:video/mpeg:*,http-get:*:audio/mpeg:*,http-get:*:image/jpeg:*,http-get:*:image/png:*"
                            getService()->getUPnPStateVariable(SOURCE_PROTOCOL_INFO)->setValue("");
                        }
开发者ID:lince,项目名称:ginga-hones,代码行数:13,代码来源:TVRConnectionManager.cpp

示例4: getSizeInPacket

int
ExternalSearchRequestData::save( Packet* packet, int& pos ) const
{
   int sizeInPacket = getSizeInPacket();
   int startPos = pos;
   packet->incWriteLong( pos, sizeInPacket );
   
   packet->incWriteLong( pos, getService() );
   packet->incWriteLong( pos, m_startHitIdx );
   packet->incWriteLong( pos, m_endHitIdx );
   packet->incWriteLong( pos, m_coord.lat );
   packet->incWriteLong( pos, m_coord.lon );
   packet->incWriteLong( pos, m_distance );
   packet->incWriteLong( pos, m_itemInfoFilter );

   m_searchParams->save( packet, pos );
   
   packet->incWriteLong( pos, m_values.size() );
   for ( stringMap_t::const_iterator it = m_values.begin();
         it != m_values.end();
         ++it ) {
      packet->incWriteLong( pos, it->first );
      packet->incWriteString( pos, it->second );
   }
   packet->incAlignWriteLong( pos );
   MC2_ASSERT( ( pos - startPos ) == sizeInPacket );
   return sizeInPacket;
}
开发者ID:FlavioFalcao,项目名称:Wayfinder-Server,代码行数:28,代码来源:ExternalSearchRequestData.cpp

示例5: getService

void AppOpsManager::startWatchingMode(int32_t op, const String16& packageName,
        const sp<IAppOpsCallback>& callback) {
    sp<IAppOpsService> service = getService();
    if (service != NULL) {
        service->startWatchingMode(op, packageName, callback);
    }
}
开发者ID:Juancarlospr5,项目名称:android_frameworks_native,代码行数:7,代码来源:AppOpsManager.cpp

示例6: toString

 /**
  * Returns a human-readable representation of a process.
  * 
  * @param processId Process' id.
  * @return Process' representation for debugging purposes.
  */
 std::string
 toString ( uint processId ) const
 {
     assert ( exists ( processId ) );
     
     std::string output;
                     
     output += "    #" ;
     output += boost::lexical_cast<std::string> ( processId ) ;
     output += ": s";
     output += boost::lexical_cast<std::string>
                   ( getService ( processId ) ) ;
     output += ", pmc=";
     output += boost::lexical_cast<std::string>
                   ( getPMC ( processId ) ) ;
     output += "\n";
     output += "        needs           : " ;
     for ( uint r = 0 ; r < _resources.size(); ++r )
     {
         output += "r" ;
         output += boost::lexical_cast<std::string>
                   ( r ) ;
         output += ":" ;
         output += boost::lexical_cast<std::string>
                   ( getRequirement ( processId, r ) ) ;
         output += "   ";
     }
     output += "\n";
     
     return output ;                
 }
开发者ID:daniperez,项目名称:roadef12-common,代码行数:37,代码来源:Processes.hpp

示例7: getService

int32_t AppOpsManager::checkOp(int32_t op, int32_t uid, const String16& callingPackage)
{
    sp<IAppOpsService> service = getService();
    return service != NULL
            ? service->checkOperation(op, uid, callingPackage)
            : APP_OPS_MANAGER_UNAVAILABLE_MODE;
}
开发者ID:MIPS,项目名称:frameworks-native,代码行数:7,代码来源:AppOpsManager.cpp

示例8: ACE_GUARD_RETURN

bool P3ReplicationGroup::fireOnChangeToPrimary() {
    ACE_GUARD_RETURN(ACE_SYNCH_RECURSIVE_MUTEX, mon, m_lock, false);
    ACE_DEBUG((LM_DEBUG, ACE_TEXT("(%t|%T)INFO: P3ReplicationGroup::fireOnChangeToPrimary - Peer is now PRIMARY!\n")));
    ACE_DEBUG((LM_DEBUG, ACE_TEXT("(%t|%T)INFO: P3ReplicationGroup::fireOnChangeToPrimary - service(%p)!\n"), getService().get()));
    bool serviceChangeStatus = getService()->changeToPrimaryRole();
    return serviceChangeStatus;
}
开发者ID:edenduthie,项目名称:rtft1,代码行数:7,代码来源:P3ReplicationGroup.cpp

示例9: getParentWindow

bool DropUserHandler::handleURI(URI& uri)
{
    if (uri.action != "drop_user")
        return false;

    wxWindow* w = getParentWindow(uri);
    UserPtr u = extractMetadataItemPtrFromURI<User>(uri);
    if (!u || !w)
        return true;
    ServerPtr s = u->getServer();
    if (!s)
        return true;

    if (wxNO == wxMessageBox(_("Are you sure?"), _("Removing User"),
        wxYES_NO|wxICON_QUESTION))
        return true;

    ProgressDialog pd(w, _("Connecting to Server..."), 1);
    pd.doShow();
    IBPP::Service svc;
    if (!getService(s.get(), svc, &pd, true)) // true = need SYSDBA password
        return true;

    try
    {
        svc->RemoveUser(wx2std(u->getUsername()));
        s->notifyObservers();
    }
    catch(IBPP::Exception& e)
    {
        wxMessageBox(e.what(), _("Error"),
            wxOK | wxICON_WARNING);
    }
    return true;
}
开发者ID:DragonZX,项目名称:flamerobin,代码行数:35,代码来源:UserDialog.cpp

示例10: getService

uint64_t TorProtocolManager::sendAddme(const AddmeReq& req)
{
    auto json = QJsonDocument{
        QJsonObject{
            {"type", "AddMe"},
            {"nick", req.nickName},
            {"address", getService(req.service).getAddress()},
            {"message", req.message}
        }
    };

    if (auto peer = getService(req.service).getPeer(req.connection)) {
        return peer->send(json);
    }

    throw runtime_error("Failed to access peer while sending addme");
}
开发者ID:jgaa,项目名称:darkspeak,代码行数:17,代码来源:torprotocolmanager.cpp

示例11: getService

URegistryKey U_EXPORT2
Collator::registerInstance(Collator* toAdopt, const Locale& locale, UErrorCode& status) 
{
    if (U_SUCCESS(status)) {
        return getService()->registerInstance(toAdopt, locale, status);
    }
    return NULL;
}
开发者ID:CucasLoon,项目名称:in-the-box,代码行数:8,代码来源:coll.cpp

示例12: sendAck

uint64_t TorProtocolManager::sendAck(const AckMsg &ack)
{

    if (auto peer = getService(ack.service).getPeer(ack.connection)) {
        return peer->sendAck(ack.what, ack.status, ack.data);
    }

    throw runtime_error("Failed to access peer while sending addme");
}
开发者ID:jgaa,项目名称:darkspeak,代码行数:9,代码来源:torprotocolmanager.cpp

示例13: getService

StringEnumeration* U_EXPORT2
BreakIterator::getAvailableLocales(void)
{
    ICULocaleService *service = getService();
    if (service == NULL) {
        return NULL;
    }
    return service->getAvailableLocales();
}
开发者ID:venkatarajasekhar,项目名称:Qt,代码行数:9,代码来源:brkiter.cpp

示例14: BuildingPtr

void BuildingFountain::deliverService()
{
  ServiceWalkerPtr walker = ServiceWalker::create( BuildingPtr( this ), getService());
  ServiceWalker::ReachedBuildings reachedBuildings = walker->getReachedBuildings( getTile().getIJ() );
  for( ServiceWalker::ReachedBuildings::iterator itBuilding = reachedBuildings.begin(); itBuilding != reachedBuildings.end(); ++itBuilding)
  {
    (*itBuilding)->applyService( walker );
  }
}
开发者ID:LMG,项目名称:opencaesar3,代码行数:9,代码来源:oc3_service_building.cpp

示例15: getService

// -------------------------------------
StringEnumeration* 
NumberFormat::getAvailableLocales(void)
{
  ICULocaleService *service = getService();
  if (service) {
    return service->getAvailableLocales();
  }
  return NULL; // no way to return error condition
}
开发者ID:gitpan,项目名称:ponie,代码行数:10,代码来源:numfmt.cpp


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