本文整理汇总了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);
}
}
示例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;
}
示例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("");
}
示例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;
}
示例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);
}
}
示例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 ;
}
示例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;
}
示例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;
}
示例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;
}
示例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");
}
示例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;
}
示例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");
}
示例13: getService
StringEnumeration* U_EXPORT2
BreakIterator::getAvailableLocales(void)
{
ICULocaleService *service = getService();
if (service == NULL) {
return NULL;
}
return service->getAvailableLocales();
}
示例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 );
}
}
示例15: getService
// -------------------------------------
StringEnumeration*
NumberFormat::getAvailableLocales(void)
{
ICULocaleService *service = getService();
if (service) {
return service->getAvailableLocales();
}
return NULL; // no way to return error condition
}