> ## 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.

# File i_topic.h

![][C++]

**Location**: `core/communication/i_topic.h`

## Classes

* [simulation\_framework::core::ITopic](https://developer.synopsys.com/docs/avxcelerate/avxcelerate-simulation-framework/reference/classsimulation__framework_1_1core_1_1ITopic.md)

## Namespaces

* [simulation\_framework](https://developer.synopsys.com/docs/avxcelerate/avxcelerate-simulation-framework/reference/namespacesimulation__framework.md)
* [simulation\_framework::core](https://developer.synopsys.com/docs/avxcelerate/avxcelerate-simulation-framework/reference/namespacesimulation__framework_1_1core.md)

## Includes

* [core/communication/i\_publisher.h](https://developer.synopsys.com/docs/avxcelerate/avxcelerate-simulation-framework/reference/i__publisher_8h.md)
* [core/communication/i\_subscriber.h](https://developer.synopsys.com/docs/avxcelerate/avxcelerate-simulation-framework/reference/i__subscriber_8h.md)
* core/export/simfwk\_core\_export.h

## Included by

* [base\_activity.h](https://developer.synopsys.com/docs/avxcelerate/avxcelerate-simulation-framework/reference/base__activity_8h.md)
* [topic.h](https://developer.synopsys.com/docs/avxcelerate/avxcelerate-simulation-framework/reference/topic_8h.md)

## Source

```cpp theme={null}


#ifndef SIMFWK_CORE_COMMUNICATION_ITOPIC_H
#define SIMFWK_CORE_COMMUNICATION_ITOPIC_H

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

namespace simulation_framework
{
namespace core
{

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

class SIMFWK_CORE_API 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

#endif  // SIMFWK_CORE_COMMUNICATION_ITOPIC_H
```

[private]: https://img.shields.io/badge/-private-red "private"

[public]: https://img.shields.io/badge/-public-brightgreen "public"

[const]: https://img.shields.io/badge/-const-lightblue "const"

[C++]: https://img.shields.io/badge/language-C%2B%2B-blue "C++"

[protected]: https://img.shields.io/badge/-protected-yellow "protected"

[static]: https://img.shields.io/badge/-static-lightgrey "static"
