mirror of
https://github.com/FirestormViewer/phoenix-firestorm.git
synced 2026-08-14 08:53:53 +00:00
Replace boost::function with std::function in FS-specific classes
This commit is contained in:
@@ -57,7 +57,7 @@ void trivialPostCoroRaw(std::string url,
|
||||
if (!status)
|
||||
{
|
||||
// If a failure routine is provided do it.
|
||||
if (!failure.empty())
|
||||
if (failure)
|
||||
{
|
||||
failure(httpResults);
|
||||
}
|
||||
@@ -65,7 +65,7 @@ void trivialPostCoroRaw(std::string url,
|
||||
else
|
||||
{
|
||||
// If a success routine is provided do it.
|
||||
if (!success.empty())
|
||||
if (success)
|
||||
{
|
||||
success(result);
|
||||
}
|
||||
@@ -113,14 +113,14 @@ void trivialGetCoroRaw(std::string url,
|
||||
|
||||
if (!status)
|
||||
{
|
||||
if (!failure.empty())
|
||||
if (failure)
|
||||
{
|
||||
failure(httpResults);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!success.empty())
|
||||
if (success)
|
||||
{
|
||||
success(result);
|
||||
}
|
||||
@@ -155,14 +155,14 @@ void trivialGetCoro(std::string url, time_t last_modified, completionCallback_t
|
||||
|
||||
if (!status)
|
||||
{
|
||||
if (!failure.empty())
|
||||
if (failure)
|
||||
{
|
||||
failure(httpResults);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!success.empty())
|
||||
if (success)
|
||||
{
|
||||
success(result);
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
|
||||
namespace FSCoreHttpUtil
|
||||
{
|
||||
typedef boost::function<void(const LLSD&)> completionCallback_t;
|
||||
typedef std::function<void(const LLSD&)> completionCallback_t;
|
||||
|
||||
void callbackHttpPostRaw(const std::string& url, std::string postData, completionCallback_t success = {}, completionCallback_t failure = {},
|
||||
LLCore::HttpHeaders::ptr_t aHeader = LLCore::HttpHeaders::ptr_t(), LLCore::HttpOptions::ptr_t options = LLCore::HttpOptions::ptr_t());
|
||||
|
||||
@@ -45,7 +45,7 @@ public:
|
||||
typedef std::function<void (const LLUUID id, const LLAvatarName& av_name)> account_name_changed_callback_t;
|
||||
|
||||
// <FS:Ansariel> Contact sets
|
||||
typedef boost::function<bool(const LLUUID& id, bool& dn_removed, std::string& custom_name)> custom_name_check_callback_t;
|
||||
typedef std::function<bool(const LLUUID& id, bool& dn_removed, std::string& custom_name)> custom_name_check_callback_t;
|
||||
void setCustomNameCheckCallback(custom_name_check_callback_t cb)
|
||||
{
|
||||
mCustomNameCheckCallback = cb;
|
||||
|
||||
@@ -46,7 +46,7 @@ void LLFilterEditor::handleKeystroke()
|
||||
}
|
||||
|
||||
// <FS:TJ> Allow any UICtrl to override the transparency with a callback
|
||||
void LLFilterEditor::setTransparencyOverrideCallback(boost::function<F32(ETypeTransparency, F32)> cb)
|
||||
void LLFilterEditor::setTransparencyOverrideCallback(std::function<F32(ETypeTransparency, F32)> cb)
|
||||
{
|
||||
// Simply setting it on the LLFilterEditor object doesn't work
|
||||
mSearchEditor->setTransparencyOverrideCallback(cb);
|
||||
|
||||
@@ -46,7 +46,7 @@ public:
|
||||
virtual ~LLFilterEditor() {}
|
||||
|
||||
// <FS:TJ> Allow any UICtrl to override the transparency with a callback
|
||||
void setTransparencyOverrideCallback(boost::function<F32(ETypeTransparency, F32)> cb) override;
|
||||
void setTransparencyOverrideCallback(std::function<F32(ETypeTransparency, F32)> cb) override;
|
||||
// </FS:TJ>
|
||||
|
||||
protected:
|
||||
|
||||
@@ -47,7 +47,7 @@ class LLUICtrl;
|
||||
|
||||
typedef std::function<LLFloater* (const LLSD& key)> LLFloaterBuildFunc;
|
||||
// [SL:KB] - Patch: UI-Base | Checked: 2010-12-01 (Catznip-3.0.0a) | Added: Catznip-2.4.0g
|
||||
typedef boost::function<const std::string& (void)> LLFloaterFileFunc;
|
||||
typedef std::function<const std::string& (void)> LLFloaterFileFunc;
|
||||
// [/SL:KB]
|
||||
|
||||
class LLFloaterReg
|
||||
|
||||
@@ -194,7 +194,7 @@ void LLLayoutPanel::handleReshape(const LLRect& new_rect, bool by_user)
|
||||
LLPanel::handleReshape(new_rect, by_user);
|
||||
|
||||
// <FS:Ansariel> Add callback for reshaping
|
||||
if (!mReshapePanelCallback.empty())
|
||||
if (mReshapePanelCallback)
|
||||
{
|
||||
mReshapePanelCallback(this, new_rect);
|
||||
}
|
||||
|
||||
@@ -205,7 +205,7 @@ public:
|
||||
void setIgnoreReshape(bool ignore) { mIgnoreReshape = ignore; }
|
||||
|
||||
// <FS:Ansariel> Add callback for reshaping
|
||||
typedef boost::function<void(LLLayoutPanel* panel, const LLRect& rect)> reshape_panel_callback_t;
|
||||
typedef std::function<void(LLLayoutPanel* panel, const LLRect& rect)> reshape_panel_callback_t;
|
||||
void setReshapePanelCallback(reshape_panel_callback_t cb) { mReshapePanelCallback = cb; }
|
||||
// </FS:Ansariel>
|
||||
|
||||
|
||||
@@ -203,7 +203,7 @@ public:
|
||||
/*virtual*/ bool setLabelArg(const std::string& key, const LLStringExplicit& text) override;
|
||||
|
||||
//<FS:TS> FIRE-11373: Autoreplace doesn't work in nearby chat bar
|
||||
typedef boost::function<void(S32&, S32&, LLWString&, S32&, const LLWString&)> autoreplace_callback_t;
|
||||
typedef std::function<void(S32&, S32&, LLWString&, S32&, const LLWString&)> autoreplace_callback_t;
|
||||
autoreplace_callback_t mAutoreplaceCallback;
|
||||
void setAutoreplaceCallback (autoreplace_callback_t cb) { mAutoreplaceCallback = cb; }
|
||||
//</FS:TS> FIRE-11373
|
||||
|
||||
@@ -240,8 +240,8 @@ public:
|
||||
ETypeTransparency getTransparencyType() const {return mTransparencyType;}
|
||||
|
||||
// <FS:TJ> Allow any UICtrl to override the transparency with a callback
|
||||
boost::function<F32(ETypeTransparency, F32)> mTransparencyOverrideCallback;
|
||||
virtual void setTransparencyOverrideCallback(boost::function<F32(ETypeTransparency, F32)> cb) { mTransparencyOverrideCallback = cb; }
|
||||
std::function<F32(ETypeTransparency, F32)> mTransparencyOverrideCallback;
|
||||
virtual void setTransparencyOverrideCallback(std::function<F32(ETypeTransparency, F32)> cb) { mTransparencyOverrideCallback = cb; }
|
||||
// </FS:TJ>
|
||||
|
||||
bool focusNextItem(bool text_entry_only);
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
#include "llimage.h"
|
||||
#include "llsd.h"
|
||||
|
||||
#include <boost/bind.hpp>
|
||||
#include <functional>
|
||||
|
||||
// This include file defines the API key/secret.
|
||||
// It is generated by cmake.
|
||||
@@ -32,7 +32,7 @@
|
||||
class exoFlickr
|
||||
{
|
||||
public:
|
||||
typedef boost::function<void(bool success, const LLSD& response)> response_callback_t;
|
||||
typedef std::function<void(bool success, const LLSD& response)> response_callback_t;
|
||||
|
||||
static void request(const std::string& method, const LLSD& args, response_callback_t callback);
|
||||
static void uploadPhoto(const LLSD& args, LLImageFormatted *image, response_callback_t callback);
|
||||
|
||||
@@ -17,14 +17,14 @@
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
#include <boost/function.hpp>
|
||||
#include <functional>
|
||||
|
||||
// This class's function is described by the flow chart at
|
||||
// https://www.flickr.com/services/api/auth.oauth.html
|
||||
class exoFlickrAuth
|
||||
{
|
||||
public:
|
||||
typedef boost::function<void(bool success, const LLSD& params)> authorized_callback_t;
|
||||
typedef std::function<void(bool success, const LLSD& params)> authorized_callback_t;
|
||||
|
||||
exoFlickrAuth(authorized_callback_t callback);
|
||||
~exoFlickrAuth();
|
||||
|
||||
@@ -97,7 +97,7 @@ FSFloaterIMTimer::FSFloaterIMTimer(FSFloaterIMTimer::callback_t callback) :
|
||||
|
||||
bool FSFloaterIMTimer::tick()
|
||||
{
|
||||
if (!mCallback.empty())
|
||||
if (mCallback)
|
||||
{
|
||||
mCallback();
|
||||
}
|
||||
|
||||
@@ -310,7 +310,7 @@ private:
|
||||
class FSFloaterIMTimer : public LLEventTimer
|
||||
{
|
||||
public:
|
||||
typedef boost::function<void()> callback_t;
|
||||
typedef std::function<void()> callback_t;
|
||||
|
||||
FSFloaterIMTimer(callback_t callback);
|
||||
/*virtual*/ bool tick();
|
||||
|
||||
@@ -2842,7 +2842,7 @@ bool FSLoadPoseTimer::tick()
|
||||
{
|
||||
if (!mAttemptLoading)
|
||||
return false;
|
||||
if (mCallback.empty())
|
||||
if (!mCallback)
|
||||
return false;
|
||||
|
||||
if (mLoadAttempts >= mMaxLoadAttempts)
|
||||
|
||||
@@ -538,7 +538,7 @@ public:
|
||||
class FSLoadPoseTimer : public LLEventTimer
|
||||
{
|
||||
public:
|
||||
typedef boost::function<void()> callback_t;
|
||||
typedef std::function<void()> callback_t;
|
||||
|
||||
FSLoadPoseTimer(callback_t callback);
|
||||
/*virtual*/ bool tick();
|
||||
|
||||
@@ -29,10 +29,10 @@
|
||||
#ifndef FS_GRIDHANDLER_H
|
||||
#define FS_GRIDHANDLER_H
|
||||
|
||||
#include "../llxml/llxmlnode.h"
|
||||
#include "llxmlnode.h"
|
||||
#include "llsingleton.h"
|
||||
|
||||
#include <boost/function.hpp>
|
||||
#include <functional>
|
||||
#include <boost/signals2.hpp>
|
||||
|
||||
extern const char* DEFAULT_LOGIN_PAGE;
|
||||
@@ -69,9 +69,6 @@ const std::string GRID_MESSAGE = "message";
|
||||
const std::string GRID_SLURL_BASE = "slurl_base";
|
||||
const std::string GRID_APP_SLURL_BASE = "app_slurl_base";
|
||||
|
||||
// Inworldz special
|
||||
#define INWORLDZ_URI "inworldz.com:8002"
|
||||
|
||||
class GridInfoRequestResponder;
|
||||
|
||||
struct GridEntry
|
||||
@@ -227,7 +224,7 @@ public:
|
||||
}
|
||||
bool isSystemGrid() const { return isSystemGrid(mGrid); }
|
||||
|
||||
typedef boost::function<void(bool success)> grid_list_changed_callback_t;
|
||||
typedef std::function<void(bool success)> grid_list_changed_callback_t;
|
||||
typedef boost::signals2::signal<void(bool success)> grid_list_changed_signal_t;
|
||||
|
||||
boost::signals2::connection addGridListChangedCallback(grid_list_changed_callback_t cb);
|
||||
|
||||
@@ -298,7 +298,7 @@ void FSPanelRadar::requestUpdate()
|
||||
|
||||
void FSPanelRadar::updateList(const std::vector<LLSD>& entries, const LLSD& stats)
|
||||
{
|
||||
if (!mVisibleCheckFunction.empty() && !mVisibleCheckFunction())
|
||||
if (!mVisibleCheckFunction)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -62,7 +62,7 @@ public:
|
||||
return mChangeSignal.connect(cb);
|
||||
}
|
||||
|
||||
typedef boost::function<bool()> visible_check_function_t;
|
||||
typedef std::function<bool()> visible_check_function_t;
|
||||
void setVisibleCheckFunction(const visible_check_function_t& func)
|
||||
{
|
||||
mVisibleCheckFunction = func;
|
||||
|
||||
@@ -52,7 +52,7 @@ public:
|
||||
CONV_SESSION_UNKNOWN = 6
|
||||
};
|
||||
|
||||
typedef boost::function<bool (const LLUUID& speaker_id)> validate_speaker_callback_t;
|
||||
typedef std::function<bool (const LLUUID& speaker_id)> validate_speaker_callback_t;
|
||||
|
||||
FSParticipantList(LLSpeakerMgr* data_source,
|
||||
LLAvatarList* avatar_list,
|
||||
|
||||
@@ -80,7 +80,7 @@ public:
|
||||
void refreshLineHeight();
|
||||
|
||||
|
||||
typedef boost::function<bool(S32, S32, MASK, bool, EDragAndDropType, void*, EAcceptance*, std::string&)> handle_dad_callback_signal_t;
|
||||
typedef std::function<bool(S32, S32, MASK, bool, EDragAndDropType, void*, EAcceptance*, std::string&)> handle_dad_callback_signal_t;
|
||||
void setHandleDaDCallback(const handle_dad_callback_signal_t& func)
|
||||
{
|
||||
mHandleDaDCallback = func;
|
||||
|
||||
@@ -144,7 +144,7 @@ static bool have_script_upload_cap(LLUUID& object_id)
|
||||
class LLCallbackTimer : public LLEventTimer
|
||||
{
|
||||
public:
|
||||
typedef boost::function<bool()> bool_func_t;
|
||||
typedef std::function<bool()> bool_func_t;
|
||||
public:
|
||||
LLCallbackTimer(F32 nPeriod, bool_func_t cb) : LLEventTimer(nPeriod), m_Callback(cb) {}
|
||||
/*virtual*/ bool tick() { return m_Callback(); }
|
||||
|
||||
@@ -142,7 +142,7 @@ public:
|
||||
void clearDebugText();
|
||||
|
||||
// <FS:CR> Import
|
||||
typedef boost::function<bool (LLViewerObject* object)> new_object_callback_t;
|
||||
typedef std::function<bool (LLViewerObject* object)> new_object_callback_t;
|
||||
typedef boost::signals2::signal<bool (LLViewerObject* object)> new_object_signal_t;
|
||||
boost::signals2::connection setNewObjectCallback(new_object_callback_t cb);
|
||||
new_object_signal_t mNewObjectSignal;
|
||||
|
||||
@@ -1054,7 +1054,7 @@ RlvCommandOptionGetPath::RlvCommandOptionGetPath(const RlvCommand& rlvCmd, getpa
|
||||
if (pObj->isAttachment())
|
||||
m_idItems.push_back(pObj->getAttachmentItemID());
|
||||
}
|
||||
else if (!cb.empty())
|
||||
else if (cb)
|
||||
{
|
||||
new RlvCommandOptionGetPathCallback(rlvCmd.getObjectID(), cb);
|
||||
m_fCallback = true;
|
||||
@@ -1067,7 +1067,7 @@ RlvCommandOptionGetPath::RlvCommandOptionGetPath(const RlvCommand& rlvCmd, getpa
|
||||
return;
|
||||
}
|
||||
|
||||
if (!cb.empty())
|
||||
if (cb)
|
||||
{
|
||||
cb(getItemIDs());
|
||||
}
|
||||
|
||||
@@ -410,7 +410,7 @@ protected:
|
||||
|
||||
struct RlvCommandOptionGetPath : public RlvCommandOption
|
||||
{
|
||||
typedef boost::function<void(const uuid_vec_t&)> getpath_callback_t;
|
||||
typedef std::function<void(const uuid_vec_t&)> getpath_callback_t;
|
||||
RlvCommandOptionGetPath(const RlvCommand& rlvCmd, getpath_callback_t cb = NULL);
|
||||
|
||||
bool isCallback() const { return m_fCallback; }
|
||||
@@ -662,7 +662,7 @@ public:
|
||||
class RlvCallbackTimerOnce : public LLEventTimer
|
||||
{
|
||||
public:
|
||||
typedef boost::function<void ()> nullary_func_t;
|
||||
typedef std::function<void ()> nullary_func_t;
|
||||
public:
|
||||
RlvCallbackTimerOnce(F32 nPeriod, nullary_func_t cb) : LLEventTimer(nPeriod), m_Callback(cb) {}
|
||||
/*virtual*/ bool tick()
|
||||
|
||||
@@ -89,7 +89,7 @@ public:
|
||||
* Member variables
|
||||
*/
|
||||
protected:
|
||||
typedef boost::function<void(bool)> behaviour_handler_t;
|
||||
typedef std::function<void(bool)> behaviour_handler_t;
|
||||
typedef std::multimap<ERlvBehaviour, behaviour_handler_t> behaviour_handler_map_t;
|
||||
behaviour_handler_map_t m_Handlers;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user