PageRenderTime 10ms CodeModel.GetById 4ms RepoModel.GetById 0ms 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
Possible License(s): LGPL-2.1
  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. #include "linden_common.h"
  29. #include "llchainio.h"
  30. #include "lliopipe.h"
  31. #include "llioutil.h"
  32. /**
  33. * LLDeferredChain
  34. */
  35. // static
  36. bool LLDeferredChain::addToPump(
  37. LLPumpIO* pump,
  38. F32 in_seconds,
  39. const LLPumpIO::chain_t& deferred_chain,
  40. F32 chain_timeout)
  41. {
  42. if(!pump) return false;
  43. LLPumpIO::chain_t sleep_chain;
  44. sleep_chain.push_back(LLIOPipe::ptr_t(new LLIOSleep(in_seconds)));
  45. sleep_chain.push_back(
  46. LLIOPipe::ptr_t(new LLIOAddChain(deferred_chain, chain_timeout)));
  47. // give it a litle bit of padding.
  48. pump->addChain(sleep_chain, in_seconds + 10.0f);
  49. return true;
  50. }
  51. /**
  52. * LLChainIOFactory
  53. */
  54. LLChainIOFactory::LLChainIOFactory()
  55. {
  56. }
  57. // virtual
  58. LLChainIOFactory::~LLChainIOFactory()
  59. {
  60. }
  61. #if 0
  62. bool LLChainIOFactory::build(LLIOPipe* in, LLIOPipe* out) const
  63. {
  64. if(!in || !out)
  65. {
  66. return false;
  67. }
  68. LLIOPipe* first = NULL;
  69. LLIOPipe* last = NULL;
  70. if(build_impl(first, last) && first && last)
  71. {
  72. in->connect(first);
  73. last->connect(out);
  74. return true;
  75. }
  76. LLIOPipe::ptr_t foo(first);
  77. LLIOPipe::ptr_t bar(last);
  78. return false;
  79. }
  80. #endif