diff options
Diffstat (limited to 'indra/llmessage')
| -rw-r--r-- | indra/llmessage/llavatarnamecache.h | 2 | ||||
| -rw-r--r-- | indra/llmessage/llcachename.cpp | 2 | ||||
| -rw-r--r-- | indra/llmessage/llcircuit.cpp | 4 | ||||
| -rw-r--r-- | indra/llmessage/llcoproceduremanager.cpp | 4 | ||||
| -rw-r--r-- | indra/llmessage/llcoproceduremanager.h | 6 | ||||
| -rw-r--r-- | indra/llmessage/llcorehttputil.cpp | 12 | ||||
| -rw-r--r-- | indra/llmessage/llcorehttputil.h | 18 | ||||
| -rw-r--r-- | indra/llmessage/llexperiencecache.cpp | 25 | ||||
| -rw-r--r-- | indra/llmessage/llexperiencecache.h | 8 | ||||
| -rw-r--r-- | indra/llmessage/lltransfertargetfile.h | 4 | ||||
| -rw-r--r-- | indra/llmessage/lltransfertargetvfile.cpp | 4 | ||||
| -rw-r--r-- | indra/llmessage/message.cpp | 8 | ||||
| -rw-r--r-- | indra/llmessage/message.h | 4 |
13 files changed, 52 insertions, 49 deletions
diff --git a/indra/llmessage/llavatarnamecache.h b/indra/llmessage/llavatarnamecache.h index fe51355207..0ddaee2aa1 100644 --- a/indra/llmessage/llavatarnamecache.h +++ b/indra/llmessage/llavatarnamecache.h @@ -42,7 +42,7 @@ class LLAvatarNameCache : public LLSingleton<LLAvatarNameCache> ~LLAvatarNameCache(); public: typedef boost::signals2::signal<void (void)> use_display_name_signal_t; - typedef boost::function<void (const LLUUID id, const LLAvatarName& av_name)> account_name_changed_callback_t; + typedef std::function<void (const LLUUID id, const LLAvatarName& av_name)> account_name_changed_callback_t; // Import/export the name cache to file. bool importFile(std::istream& istr); diff --git a/indra/llmessage/llcachename.cpp b/indra/llmessage/llcachename.cpp index 4980e0a1da..56dfaef873 100644 --- a/indra/llmessage/llcachename.cpp +++ b/indra/llmessage/llcachename.cpp @@ -600,7 +600,7 @@ std::string LLCacheName::buildLegacyName(const std::string& complete_name) // This is a little bit kludgy. LLCacheNameCallback is a slot instead of a function pointer. // The reason it is a slot is so that the legacy get() function below can bind an old callback -// and pass it as a slot. The reason it isn't a boost::function is so that trackable behavior +// and pass it as a slot. The reason it isn't a std::function is so that trackable behavior // doesn't get lost. As a result, we have to bind the slot to a signal to call it, even when // we call it immediately. -Steve // NOTE: Even though passing first and last name is a bit of extra overhead, it eliminates the diff --git a/indra/llmessage/llcircuit.cpp b/indra/llmessage/llcircuit.cpp index 8f9c02bdca..c2b1a2f069 100644 --- a/indra/llmessage/llcircuit.cpp +++ b/indra/llmessage/llcircuit.cpp @@ -71,8 +71,8 @@ LLCircuitData::LLCircuitData(const LLHost &host, TPACKETID in_id, mPacketsOutID(0), mPacketsInID(in_id), mHighestPacketID(in_id), - mTimeoutCallback(NULL), - mTimeoutUserData(NULL), + mTimeoutCallback(nullptr), + mTimeoutUserData(nullptr), mTrusted(false), mbAllowTimeout(true), mbAlive(true), diff --git a/indra/llmessage/llcoproceduremanager.cpp b/indra/llmessage/llcoproceduremanager.cpp index 99b40e0877..0e5725baf3 100644 --- a/indra/llmessage/llcoproceduremanager.cpp +++ b/indra/llmessage/llcoproceduremanager.cpp @@ -155,8 +155,8 @@ LLCoprocedureManager::~LLCoprocedureManager() // Shutting down, just log it LL_WARNS() << "Exception during ~LLCoprocedureManager(): " << e.what() << LL_ENDL; } - mPropertyQueryFn.clear(); - mPropertyDefineFn.clear(); + mPropertyQueryFn = nullptr; + mPropertyDefineFn = nullptr; mPoolMap.clear(); } diff --git a/indra/llmessage/llcoproceduremanager.h b/indra/llmessage/llcoproceduremanager.h index 485333657c..f6f9a5783b 100644 --- a/indra/llmessage/llcoproceduremanager.h +++ b/indra/llmessage/llcoproceduremanager.h @@ -41,10 +41,10 @@ class LLCoprocedureManager : public LLSingleton < LLCoprocedureManager > virtual ~LLCoprocedureManager(); public: - typedef boost::function<U32(const std::string &)> SettingQuery_t; - typedef boost::function<void(const std::string &, U32, const std::string &)> SettingUpdate_t; + typedef std::function<U32(const std::string &)> SettingQuery_t; + typedef std::function<void(const std::string &, U32, const std::string &)> SettingUpdate_t; - typedef boost::function<void(LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t &, const LLUUID &id)> CoProcedure_t; + typedef std::function<void(LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t &, const LLUUID &id)> CoProcedure_t; /// Places the coprocedure on the queue for processing. /// diff --git a/indra/llmessage/llcorehttputil.cpp b/indra/llmessage/llcorehttputil.cpp index 28d9339bcf..b24e5e4fcc 100644 --- a/indra/llmessage/llcorehttputil.cpp +++ b/indra/llmessage/llcorehttputil.cpp @@ -57,7 +57,7 @@ namespace inline bool getBoolSetting(const std::string &keyname) { - if (!mBoolSettingGet || mBoolSettingGet.empty()) + if (mBoolSettingGet == nullptr) return(false); return mBoolSettingGet(HTTP_LOGBODY_KEY); } @@ -69,7 +69,7 @@ void setPropertyMethods(BoolSettingQuery_t queryfn, BoolSettingUpdate_t updatefn mBoolSettingGet = queryfn; mBoolSettingPut = updatefn; - if (mBoolSettingPut && !mBoolSettingPut.empty()) + if (mBoolSettingPut != nullptr) { mBoolSettingPut(HTTP_LOGBODY_KEY, false, "Log the entire HTTP body in the case of an HTTP error."); } @@ -1236,9 +1236,9 @@ void HttpCoroutineAdapter::callbackHttpGet(const std::string &url, LLCore::HttpR /*static*/ void HttpCoroutineAdapter::messageHttpGet(const std::string &url, const std::string &success, const std::string &failure) { - completionCallback_t cbSuccess = (success.empty()) ? NULL : + completionCallback_t cbSuccess = (success.empty()) ? nullptr : static_cast<completionCallback_t>(boost::bind(&logMessageSuccess, "HttpCoroutineAdapter", url, success)); - completionCallback_t cbFailure = (failure.empty()) ? NULL : + completionCallback_t cbFailure = (failure.empty()) ? nullptr : static_cast<completionCallback_t>(boost::bind(&logMessageFail, "HttpCoroutineAdapter", url, failure)); callbackHttpGet(url, cbSuccess, cbFailure); } @@ -1286,9 +1286,9 @@ void HttpCoroutineAdapter::callbackHttpPost(const std::string &url, LLCore::Http /*static*/ void HttpCoroutineAdapter::messageHttpPost(const std::string &url, const LLSD &postData, const std::string &success, const std::string &failure) { - completionCallback_t cbSuccess = (success.empty()) ? NULL : + completionCallback_t cbSuccess = (success.empty()) ? nullptr : static_cast<completionCallback_t>(boost::bind(&logMessageSuccess, "HttpCoroutineAdapter", url, success)); - completionCallback_t cbFailure = (failure.empty()) ? NULL : + completionCallback_t cbFailure = (failure.empty()) ? nullptr : static_cast<completionCallback_t>(boost::bind(&logMessageFail, "HttpCoroutineAdapter", url, failure)); callbackHttpPost(url, postData, cbSuccess, cbFailure); diff --git a/indra/llmessage/llcorehttputil.h b/indra/llmessage/llcorehttputil.h index 111fa6a1a0..3dbfd6f00d 100644 --- a/indra/llmessage/llcorehttputil.h +++ b/indra/llmessage/llcorehttputil.h @@ -58,8 +58,8 @@ namespace LLCoreHttpUtil { /// Allow access to to the property settings methods. -typedef boost::function<bool(const std::string &)> BoolSettingQuery_t; -typedef boost::function<void(const std::string &, bool, const std::string &)> BoolSettingUpdate_t; +typedef std::function<bool(const std::string &)> BoolSettingQuery_t; +typedef std::function<void(const std::string &, bool, const std::string &)> BoolSettingUpdate_t; void setPropertyMethods(BoolSettingQuery_t queryfn, BoolSettingUpdate_t updatefn); @@ -585,21 +585,21 @@ public: /// should match this form. /// @sa callbackHttpGet /// @sa callbackHttpPost - typedef boost::function<void(const LLSD &)> completionCallback_t; + typedef std::function<void(const LLSD &)> completionCallback_t; - static void callbackHttpGet(const std::string &url, LLCore::HttpRequest::policy_t policyId, completionCallback_t success = NULL, completionCallback_t failure = NULL); - static void callbackHttpGet(const std::string &url, completionCallback_t success = NULL, completionCallback_t failure = NULL) + static void callbackHttpGet(const std::string &url, LLCore::HttpRequest::policy_t policyId, completionCallback_t success = nullptr, completionCallback_t failure = nullptr); + static void callbackHttpGet(const std::string &url, completionCallback_t success = nullptr, completionCallback_t failure = nullptr) { callbackHttpGet(url, LLCore::HttpRequest::DEFAULT_POLICY_ID, success, failure); } - static void callbackHttpPost(const std::string &url, LLCore::HttpRequest::policy_t policyId, const LLSD &postData, completionCallback_t success = NULL, completionCallback_t failure = NULL); - static void callbackHttpPost(const std::string &url, const LLSD &postData, completionCallback_t success = NULL, completionCallback_t failure = NULL) + static void callbackHttpPost(const std::string &url, LLCore::HttpRequest::policy_t policyId, const LLSD &postData, completionCallback_t success = nullptr, completionCallback_t failure = nullptr); + static void callbackHttpPost(const std::string &url, const LLSD &postData, completionCallback_t success = nullptr, completionCallback_t failure = nullptr) { callbackHttpPost(url, LLCore::HttpRequest::DEFAULT_POLICY_ID, postData, success, failure); } - static void callbackHttpDel(const std::string &url, LLCore::HttpRequest::policy_t policyId, completionCallback_t success = NULL, - completionCallback_t failure = NULL); + static void callbackHttpDel(const std::string& url, LLCore::HttpRequest::policy_t policyId, completionCallback_t success = nullptr, + completionCallback_t failure = nullptr); /// Generic Get and post routines for HTTP via coroutines. /// These static methods do all required setup for the GET or POST operation. diff --git a/indra/llmessage/llexperiencecache.cpp b/indra/llmessage/llexperiencecache.cpp index c8e0d8a671..149741b9f9 100644 --- a/indra/llmessage/llexperiencecache.cpp +++ b/indra/llmessage/llexperiencecache.cpp @@ -35,7 +35,6 @@ #include <set> #include <map> #include <boost/tokenizer.hpp> -#include <boost/concept_check.hpp> //========================================================================= namespace LLExperienceCacheImpl @@ -320,7 +319,7 @@ void LLExperienceCache::requestExperiencesCoro(LLCoreHttpUtil::HttpCoroutineAdap void LLExperienceCache::requestExperiences() { - if (mCapability.empty()) + if (mCapability == nullptr) { LL_WARNS("ExperienceCache") << "Capability query method not set." << LL_ENDL; return; @@ -538,7 +537,7 @@ void LLExperienceCache::get(const LLUUID& key, LLExperienceCache::ExperienceGetF //========================================================================= void LLExperienceCache::fetchAssociatedExperience(const LLUUID& objectId, const LLUUID& itemId, ExperienceGetFn_t fn) { - if (mCapability.empty()) + if (mCapability == nullptr) { LL_WARNS("ExperienceCache") << "Capability query method not set." << LL_ENDL; return; @@ -550,7 +549,7 @@ void LLExperienceCache::fetchAssociatedExperience(const LLUUID& objectId, const void LLExperienceCache::fetchAssociatedExperience(const LLUUID& objectId, const LLUUID& itemId, std::string url, ExperienceGetFn_t fn) { - if (mCapability.empty()) + if (mCapability == nullptr) { LL_WARNS("ExperienceCache") << "Capability query method not set." << LL_ENDL; return; @@ -600,8 +599,10 @@ void LLExperienceCache::fetchAssociatedExperienceCoro(LLCoreHttpUtil::HttpCorout failure["error"] = -1; failure["message"] = "no experience"; } - if (fn && !fn.empty()) + if (fn != nullptr) + { fn(failure); + } return; } @@ -612,7 +613,7 @@ void LLExperienceCache::fetchAssociatedExperienceCoro(LLCoreHttpUtil::HttpCorout //------------------------------------------------------------------------- void LLExperienceCache::findExperienceByName(const std::string text, int page, ExperienceGetFn_t fn) { - if (mCapability.empty()) + if (mCapability == nullptr) { LL_WARNS("ExperienceCache") << "Capability query method not set." << LL_ENDL; return; @@ -655,7 +656,7 @@ void LLExperienceCache::findExperienceByNameCoro(LLCoreHttpUtil::HttpCoroutineAd //------------------------------------------------------------------------- void LLExperienceCache::getGroupExperiences(const LLUUID &groupId, ExperienceGetFn_t fn) { - if (mCapability.empty()) + if (mCapability == nullptr) { LL_WARNS("ExperienceCache") << "Capability query method not set." << LL_ENDL; return; @@ -743,7 +744,7 @@ void LLExperienceCache::regionExperiencesCoro(LLCoreHttpUtil::HttpCoroutineAdapt //------------------------------------------------------------------------- void LLExperienceCache::getExperiencePermission(const LLUUID &experienceId, ExperienceGetFn_t fn) { - if (mCapability.empty()) + if (mCapability == nullptr) { LL_WARNS("ExperienceCache") << "Capability query method not set." << LL_ENDL; return; @@ -767,7 +768,7 @@ void LLExperienceCache::getExperiencePermission(const LLUUID &experienceId, Expe void LLExperienceCache::setExperiencePermission(const LLUUID &experienceId, const std::string &permission, ExperienceGetFn_t fn) { - if (mCapability.empty()) + if (mCapability == nullptr) { LL_WARNS("ExperienceCache") << "Capability query method not set." << LL_ENDL; return; @@ -797,7 +798,7 @@ void LLExperienceCache::setExperiencePermission(const LLUUID &experienceId, cons void LLExperienceCache::forgetExperiencePermission(const LLUUID &experienceId, ExperienceGetFn_t fn) { - if (mCapability.empty()) + if (mCapability == nullptr) { LL_WARNS("ExperienceCache") << "Capability query method not set." << LL_ENDL; return; @@ -841,7 +842,7 @@ void LLExperienceCache::experiencePermissionCoro(LLCoreHttpUtil::HttpCoroutineAd //------------------------------------------------------------------------- void LLExperienceCache::getExperienceAdmin(const LLUUID &experienceId, ExperienceGetFn_t fn) { - if (mCapability.empty()) + if (mCapability == nullptr) { LL_WARNS("ExperienceCache") << "Capability query method not set." << LL_ENDL; return; @@ -873,7 +874,7 @@ void LLExperienceCache::getExperienceAdminCoro(LLCoreHttpUtil::HttpCoroutineAdap //------------------------------------------------------------------------- void LLExperienceCache::updateExperience(LLSD updateData, ExperienceGetFn_t fn) { - if (mCapability.empty()) + if (mCapability == nullptr) { LL_WARNS("ExperienceCache") << "Capability query method not set." << LL_ENDL; return; diff --git a/indra/llmessage/llexperiencecache.h b/indra/llmessage/llexperiencecache.h index 81e904107f..4b344347d5 100644 --- a/indra/llmessage/llexperiencecache.h +++ b/indra/llmessage/llexperiencecache.h @@ -35,7 +35,7 @@ #include "llsd.h" #include "llcorehttputil.h" #include <boost/signals2.hpp> -#include <boost/function.hpp> +#include <functional> class LLSD; class LLUUID; @@ -46,8 +46,8 @@ class LLExperienceCache: public LLSingleton < LLExperienceCache > LLSINGLETON(LLExperienceCache); public: - typedef boost::function<std::string(const std::string &)> CapabilityQuery_t; - typedef boost::function<void(const LLSD &)> ExperienceGetFn_t; + typedef std::function<std::string(const std::string &)> CapabilityQuery_t; + typedef std::function<void(const LLSD &)> ExperienceGetFn_t; void setCapabilityQuery(CapabilityQuery_t queryfn); void cleanup(); @@ -108,7 +108,7 @@ private: virtual void initSingleton() override; - typedef boost::function<LLSD(LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t &, LLCore::HttpRequest::ptr_t, std::string)> permissionInvoker_fn; + typedef std::function<LLSD(LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t &, LLCore::HttpRequest::ptr_t, std::string)> permissionInvoker_fn; // Callback types for get() typedef boost::signals2::signal < void(const LLSD &) > callback_signal_t; diff --git a/indra/llmessage/lltransfertargetfile.h b/indra/llmessage/lltransfertargetfile.h index 43189eb388..cca0ea8d04 100644 --- a/indra/llmessage/lltransfertargetfile.h +++ b/indra/llmessage/lltransfertargetfile.h @@ -37,8 +37,8 @@ public: LLTransferTargetParamsFile() : LLTransferTargetParams(LLTTT_FILE), - mCompleteCallback(NULL), - mUserData(NULL) + mCompleteCallback(nullptr), + mUserData(nullptr) {} void setFilename(const std::string& filename) { mFilename = filename; } void setCallback(LLTTFCompleteCallback cb, void *user_data) { mCompleteCallback = cb; mUserData = user_data; } diff --git a/indra/llmessage/lltransfertargetvfile.cpp b/indra/llmessage/lltransfertargetvfile.cpp index fcf853845b..bbc2ddf4cc 100644 --- a/indra/llmessage/lltransfertargetvfile.cpp +++ b/indra/llmessage/lltransfertargetvfile.cpp @@ -41,8 +41,8 @@ void LLTransferTargetVFile::updateQueue(bool shutdown) LLTransferTargetParamsVFile::LLTransferTargetParamsVFile() : LLTransferTargetParams(LLTTT_VFILE), mAssetType(LLAssetType::AT_NONE), - mCompleteCallback(NULL), - mRequestDatap(NULL), + mCompleteCallback(nullptr), + mRequestDatap(nullptr), mErrCode(0) { } diff --git a/indra/llmessage/message.cpp b/indra/llmessage/message.cpp index 2a619dab98..e2937490ba 100644 --- a/indra/llmessage/message.cpp +++ b/indra/llmessage/message.cpp @@ -1162,7 +1162,7 @@ S32 LLMessageSystem::sendMessage(const LLHost &host) { LLSD message = mLLSDMessageBuilder->getMessage(); - UntrustedCallback_t cb = NULL; + UntrustedCallback_t cb = nullptr; if ((mSendReliable) && (mReliablePacketParams.mCallback)) { cb = boost::bind(mReliablePacketParams.mCallback, mReliablePacketParams.mCallbackData, _1); @@ -1359,7 +1359,7 @@ S32 LLMessageSystem::sendMessage( return 0; } - UntrustedCallback_t cb = NULL; + UntrustedCallback_t cb = nullptr; if ((mSendReliable) && (mReliablePacketParams.mCallback)) { cb = boost::bind(mReliablePacketParams.mCallback, mReliablePacketParams.mCallbackData, _1); @@ -4049,8 +4049,10 @@ void LLMessageSystem::sendUntrustedSimulatorMessageCoro(std::string url, std::st LLSD httpResults = result[LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS]; LLCore::HttpStatus status = LLCoreHttpUtil::HttpCoroutineAdapter::getStatusFromLLSD(httpResults); - if ((callback) && (!callback.empty())) + if (callback != nullptr) + { callback((status) ? LL_ERR_NOERR : LL_ERR_TCP_TIMEOUT); + } } diff --git a/indra/llmessage/message.h b/indra/llmessage/message.h index 30945cac51..14cdc48a07 100644 --- a/indra/llmessage/message.h +++ b/indra/llmessage/message.h @@ -28,6 +28,7 @@ #define LL_MESSAGE_H #include <cstring> +#include <functional> #include <set> #if LL_LINUX @@ -55,7 +56,6 @@ #include "llmessagesenderinterface.h" #include "llstoredmessage.h" -#include "boost/function.hpp" #include "llpounceable.h" #include "llcoros.h" #include LLCOROS_MUTEX_HEADER @@ -826,7 +826,7 @@ public: void receivedMessageFromTrustedSender(); private: - typedef boost::function<void(S32)> UntrustedCallback_t; + typedef std::function<void(S32)> UntrustedCallback_t; void sendUntrustedSimulatorMessageCoro(std::string url, std::string message, LLSD body, UntrustedCallback_t callback); |
