| 916 | #ifndef OPENDDS_NO_MULTI_TOPIC |
| 917 | |
| 918 | DDS::MultiTopic_ptr DomainParticipantImpl::create_multitopic( |
| 919 | const char* name, const char* type_name, |
| 920 | const char* subscription_expression, |
| 921 | const DDS::StringSeq& expression_parameters) |
| 922 | { |
| 923 | ACE_GUARD_RETURN(ACE_Recursive_Thread_Mutex, guard, topics_protector_, 0); |
| 924 | |
| 925 | if (topics_.count(name)) { |
| 926 | if (DCPS_debug_level > 3) { |
| 927 | ACE_ERROR((LM_ERROR, ACE_TEXT("(%P|%t) ERROR: ") |
| 928 | ACE_TEXT("DomainParticipantImpl::create_multitopic, ") |
| 929 | ACE_TEXT("can't create a multi topic due to name \"%C\" ") |
| 930 | ACE_TEXT("already in use by a Topic.\n"), name)); |
| 931 | } |
| 932 | return 0; |
| 933 | } |
| 934 | |
| 935 | if (topic_descrs_.count(name)) { |
| 936 | if (DCPS_debug_level > 3) { |
| 937 | ACE_ERROR((LM_ERROR, ACE_TEXT("(%P|%t) ERROR: ") |
| 938 | ACE_TEXT("DomainParticipantImpl::create_multitopic, ") |
| 939 | ACE_TEXT("can't create a multi topic due to name \"%C\" ") |
| 940 | ACE_TEXT("already in use by a TopicDescription.\n"), name)); |
| 941 | } |
| 942 | return 0; |
| 943 | } |
| 944 | |
| 945 | DDS::MultiTopic_var mt; |
| 946 | try { |
| 947 | mt = new MultiTopicImpl(name, type_name, subscription_expression, |
| 948 | expression_parameters, this); |
| 949 | } catch (const std::exception& e) { |
| 950 | if (DCPS_debug_level) { |
| 951 | ACE_ERROR((LM_ERROR, ACE_TEXT("(%P|%t) ERROR: ") |
| 952 | ACE_TEXT("DomainParticipantImpl::create_multitopic, ") |
| 953 | ACE_TEXT("can't create a multi topic due to runtime error: ") |
| 954 | ACE_TEXT("%C.\n"), e.what())); |
| 955 | } |
| 956 | return 0; |
| 957 | } |
| 958 | DDS::TopicDescription_var td = DDS::TopicDescription::_duplicate(mt); |
| 959 | topic_descrs_[name] = td; |
| 960 | return mt._retn(); |
| 961 | } |
| 962 | |
| 963 | DDS::ReturnCode_t DomainParticipantImpl::delete_multitopic( |
| 964 | DDS::MultiTopic_ptr a_multitopic) |