STL Design PatternsTerminal Manager DocumentationRouting Table DocumentationSTL Design Patterns Source CodeStandard Template Library (STL) has been a part of C++ for a very long timebut many people who have embraced C++ still hesitate in using STL in theirprojects. There is a feeling that STL is difficult and hard to learn. Nothingcould be further from truth. STL is simple to use, debugged and efficient code.STL can reduce the amount on mundane repetitive code that takes up so muchof project time.In this series of articles we will consider some real life design patterns from Embeddedand Real-time systems and develop them using STL. These examples will illustratehow easy it is to implement complex design patterns with very little coding.mapOur examples in this article focus on the STL map. Map allows you to storedata so that it can be quickly accessed via a key. For example consider a phonenumber of circuit mapping in a switching system. The phone numbers have such awide range that an array cannot be defined to provide a quick access from thephone number to the circuit. Searching through all entries is not an option asit would be too expensive. Map addresses this problem by providing aquick access mechanism. This mechanism is implemented using red-black trees.Fortunately using map does not require understanding its internal operations.The following examples show two embedded system patterns implemented using maps:Terminal ManagerRouting TableTerminal Manager exemplifies a typical design pattern seen in embeddedsystems. Here a collection of terminals is being managed by the TerminalManager. Management involves routing messages, creating and deleting terminals.(We more details about this design pattern refer toManagerDesign Pattern).The Terminal Manager implements the following methods:Add_Terminal: Create and add a new terminalRemove_Terminal: Remove and delete a terminalFind_Terminal: Find a terminal from its terminal_IdHandle_Message: Route the received message to the Terminal objectTerminal Manager00009 #include