OpenSDN source code
message_builder.cc
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2013 Juniper Networks, Inc. All rights reserved.
3  * Copyright Contributors to the OpenSDN project
4  */
5 
6 #include "bgp/message_builder.h"
9 #include "bgp/bgp_factory.h"
10 
13 
15  RibExportPolicy::Encoding encoding) {
16  if (encoding == RibExportPolicy::BGP) {
17  if (bgp_message_builder_ == NULL) {
19  BgpStaticObjectFactory::Create<BgpMessageBuilder>();
20  }
21  return bgp_message_builder_;
22  } else if (encoding == RibExportPolicy::XMPP) {
23  if (xmpp_message_builder_ == NULL) {
25  BgpStaticObjectFactory::Create<BgpXmppMessageBuilder>();
26  }
27  return xmpp_message_builder_;
28  }
29  return NULL;
30 }
static MessageBuilder * GetInstance(RibExportPolicy::Encoding encoding)
static BgpXmppMessageBuilder * xmpp_message_builder_
static BgpMessageBuilder * bgp_message_builder_