See the code below.

```cpp
#pragma once

#include "cocos2d.h"
#include "SynthesizeMacros.h"
#include "StateModel.h"

/**
 * state machine
 */
class StateMachine {
protected:.
    /**
     * name of the state machine
     */
    PROP(std::string, _name, name)
    /**
     * current state
     */
    PROP_READONLY_PASS_BY_REF(std::string, _state, state)
    /**
     * previous state
     */
    PROP_READONLY_PASS_BY_REF(std::string, _prevState, prevState)
    /**
     * state model map
     */
    std::map<std::string, std::unique_ptr<StateModel>> _stateModelMap;

public:.
    /**
     * execute in main loop.
     */
    virtual void update(float delta);

#pragma mark add state model

public:.
    /**
     * Add State in the model.
     */
    void add(const std::string &name, std::unique_ptr<StateModel> model);
    /**
     * method to get StateModel from name
     */
    

#pragma mark control

public:.
    /**
     * initialize
     */
    void init(const std::string &name, const std::string &initialState);
    /**
     * transition state.
     */
    bool change(const std::string &state);
    /**
     * determine if the names match.
     */
    bool isName(const std::string &name) const;
};
```

I want to add a method to this class to get the StateModel from name.
Can you please advise what method I should add?

Translated with www.DeepL.com/Translator (free version)