Files
SingularityViewer/indra/newview/llfloaterregiondebugconsole.h
Aleric Inglewood 2a88f7d7c4 ResponderAdapter stuff
Renamed AICurlInterface::Responder to AICurlInterface::ResponderBase,
but without the virtual 'event' methods.
Derived from that: Responder and ReponderWithCompleted, where the
first defines result = 0, ErrorWithContent and error, and the latter
completedRaw and completed.
Added HttpClient::IgnoreBody, derived from Responder and implementing
'result' doing nothing; HttpClient::Ignore is now derived from
IgnoreBody and defines the still pure virtual getHTTPTimeoutPolicy.

Added ResponderBase::decode_body, which is now the sole place
where the code makes the decision wether some response data might be
LLSD or not based on the http status result. Before it just tried
to decode everything as LLSD, which seems a bit nonsense.

ResponderWithCompleted::completed no longer does anything, since
classes derived from ResponderWithCompleted are expected to override it,
or never call it by overriding completedRaw.

Entry point is now ResponderBase::finished = 0, instead of
completedRaw, where ResponderWithCompleted implements finished by
called completedRaw, but Responder doesn't: that directly calls
result/errorWithContent/error. Or, for the hack ResponderAdapter,
the entry points are pubResult/pubErrorWithContent.
Those are now the ONLY public methods, so more confusion.
mFinished is now set in all cases.

As a result of all that, it is no longer possible to accidently
pass a responder to ResponderAdapter that would break because it
expects completed() and completedRaw() to be called.

Added LLBufferArray::writeChannelTo.

Fixed bug for BlockingResponder::body (returned reference to temporary).

LLSDMessage::ResponderAdapter now allows a "timeoutpolicy" name
to be passed (not doing so results in the default timings), so
that the timeout policy of the used responder is retained.

Fixed llfasttimerview.cpp to test LLSDSerialize::fromXML() to return
a positive value instead of non-zero, because it may return -1 when the
parsing fails (three places).

Removed LLHTTPClient::Responder as base class from
LLFloaterRegionDebugConsole completely: it isn't a responder!

Several other responder classes were simplified a bit in order to
compile again with the above changes.
2012-10-26 04:13:29 +02:00

66 lines
2.0 KiB
C++

/**
* @file llfloaterregiondebugconsole.h
* @author Brad Kittenbrink <brad@lindenlab.com>
* @brief Quick and dirty console for region debug settings
*
* $LicenseInfo:firstyear=2010&license=viewerlgpl$
* Second Life Viewer Source Code
* Copyright (C) 2010, Linden Research, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation;
* version 2.1 of the License only.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$
*/
#ifndef LL_LLFLOATERREGIONDEBUGCONSOLE_H
#define LL_LLFLOATERREGIONDEBUGCONSOLE_H
#include <boost/signals2.hpp>
#include "llfloater.h"
#include "llhttpclient.h"
class LLTextEditor;
class AIHTTPTimeoutPolicy;
extern AIHTTPTimeoutPolicy floaterRegionDebugConsole_timeout;
typedef boost::signals2::signal<
void (const std::string& output)> console_reply_signal_t;
class LLFloaterRegionDebugConsole : public LLFloater, public LLSingleton<LLFloaterRegionDebugConsole>
{
public:
LLFloaterRegionDebugConsole();
virtual ~LLFloaterRegionDebugConsole();
// virtual
BOOL postBuild();
void onClose(bool app_quitting);
void onInput(LLUICtrl* ctrl, const LLSD& param);
LLTextEditor * mOutput;
static boost::signals2::connection setConsoleReplyCallback(const console_reply_signal_t::slot_type& cb);
private:
void onReplyReceived(const std::string& output);
boost::signals2::connection mReplySignalConnection;
};
#endif // LL_LLFLOATERREGIONDEBUGCONSOLE_H