/* Network-Integrated Multimedia Middleware (NMM)
 * http://www.motama.com/nmm.html
 *  
 * Copyright (C) 2006-2007
 * Motama GmbH, Saarbruecken, Germany
 * http://www.motama.com
 *  
 * This file is part of NMM. 
 * 
 * NMM is free software; you can redistribute it and/or modify it    
 * under the terms of the GNU General Public License as published by 
 * the Free Software Foundation; only version 2 of the License.      
 * 
 * NMM 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 General Public 
 * License for more details.  
 * 
 * You should have received a copy of the GNU General Public License 
 * along with NMM; if not, write to the Free Software Foundation,    
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
 *
 */

/** @file StaticLocalStrategy.hpp
 *
 * This file must be included to guarantee linking of static
 * constructors of %LocalStrategy when --enable-static is set.
 *
 * @see LocalStrategy
 */

#ifndef NMM_STATIC_LOCAL_STRATEGY_HPP
#define NMM_STATIC_LOCAL_STRATEGY_HPP NMM_STATIC_LOCAL_STRATEGY_HPP

#include "nmm/nmm_prefix.hpp"

#ifdef HAVE_CONFIG_H
#include "config.h"
#endif

#ifdef ENABLE_STATIC

#include "TTSFactoryRegistrator.hpp"
#include "TSFactoryObject.hpp"
#include "LocalStrategy.hpp"

namespace NMM {
  
  /** This file can be removed.
   */
  extern TTSFactoryRegistrator< TTSFactoryObject<LocalStrategy> >
  __local_strategy_prototype;
  
  static TSFactoryRegistrator* __static_local_strategy[] = {
    &__local_strategy_prototype,
    0
  };

  // XXX: fw: pretend that the above list is used (prevent warning and make sure it is linked)
  // XXX: fw: doesn't work, causes segfault because of order of static object instantiation.
//   static class DummyLocalStrategy {
//   public:
//     DummyLocalStrategy() {
//       for(TSFactoryRegistrator** ptr = __static_local_strategy;
//           *ptr != 0;
//           ++ptr) {
//         (*ptr)->dummy();
//       }
//     }
//   } __dummy_local_strategy;
  
}

#endif

#include "nmm/nmm_suffix.hpp"

#endif
