PageRenderTime 15ms CodeModel.GetById 1ms app.highlight 8ms RepoModel.GetById 2ms app.codeStats 0ms

/indra/llmessage/llchainio.cpp

https://bitbucket.org/lindenlab/viewer-beta/
C++ | 88 lines | 44 code | 8 blank | 36 comment | 6 complexity | dffb771980bc8338e3a2149d4dfe65d9 MD5 | raw file
 1/** 
 2 * @file llchainio.cpp
 3 * @author Phoenix
 4 * @date 2005-08-04
 5 * @brief Implementaiton of the chain factory.
 6 *
 7 * $LicenseInfo:firstyear=2005&license=viewerlgpl$
 8 * Second Life Viewer Source Code
 9 * Copyright (C) 2010, Linden Research, Inc.
10 * 
11 * This library is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU Lesser General Public
13 * License as published by the Free Software Foundation;
14 * version 2.1 of the License only.
15 * 
16 * This library is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
19 * Lesser General Public License for more details.
20 * 
21 * You should have received a copy of the GNU Lesser General Public
22 * License along with this library; if not, write to the Free Software
23 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
24 * 
25 * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
26 * $/LicenseInfo$
27 */
28
29#include "linden_common.h"
30#include "llchainio.h"
31
32#include "lliopipe.h"
33#include "llioutil.h"
34
35
36/**
37 * LLDeferredChain
38 */
39// static
40bool LLDeferredChain::addToPump(
41	LLPumpIO* pump,
42	F32 in_seconds,
43	const LLPumpIO::chain_t& deferred_chain,
44	F32 chain_timeout)
45{
46	if(!pump) return false;
47	LLPumpIO::chain_t sleep_chain;
48	sleep_chain.push_back(LLIOPipe::ptr_t(new LLIOSleep(in_seconds)));
49	sleep_chain.push_back(
50		LLIOPipe::ptr_t(new LLIOAddChain(deferred_chain, chain_timeout)));
51
52	// give it a litle bit of padding.
53	pump->addChain(sleep_chain, in_seconds + 10.0f);
54	return true;
55}
56
57/**
58 * LLChainIOFactory
59 */
60LLChainIOFactory::LLChainIOFactory()
61{
62}
63
64// virtual
65LLChainIOFactory::~LLChainIOFactory()
66{
67}
68
69#if 0
70bool LLChainIOFactory::build(LLIOPipe* in, LLIOPipe* out) const
71{
72	if(!in || !out)
73	{
74		return false;
75	}
76	LLIOPipe* first = NULL;
77	LLIOPipe* last = NULL;
78	if(build_impl(first, last) && first && last)
79	{
80		in->connect(first);
81		last->connect(out);
82		return true;
83	}
84	LLIOPipe::ptr_t foo(first);
85	LLIOPipe::ptr_t bar(last);
86	return false;
87}
88#endif