> ## Documentation Index
> Fetch the complete documentation index at: https://developer.synopsys.com/llms.txt
> Use this file to discover all available pages before exploring further.

# i_topic.h

```cpp theme={null}
#pragma once

#include "core/communication/i_publisher.h"
#include "core/communication/i_subscriber.h"

namespace simulation_framework
{
namespace core
{

enum class TopicType
{
    kRTIDDS = 0,
    kGRPC
};
using TopicId = std::string;

class ITopic
{
 public:
 virtual ~ITopic() = default;

 virtual TopicId GetId() const = 0;

 virtual TopicType GetType() const = 0;

 virtual std::size_t SubscriberCount() const = 0;

 virtual std::size_t PublisherCount() const = 0;

 virtual void AddPublisher(std::unique_ptr<IPublisher> pub_ptr) = 0;

 virtual void AddSubscriber(std::unique_ptr<ISubscriber> sub_ptr) = 0;

 virtual void ClearPubSub() = 0;

 virtual const Subscribers& GetSubscribers() const = 0;

 virtual const Publishers& GetPublishers() const = 0;
};

using TopicIdVector = std::vector<TopicId>;
using Topics = std::vector<std::shared_ptr<ITopic>>;

}  // namespace core
}  // namespace simulation_framework
```
