Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NetworkNode types #144

Closed
eliemichel opened this issue Sep 16, 2015 · 2 comments
Closed

NetworkNode types #144

eliemichel opened this issue Sep 16, 2015 · 2 comments

Comments

@eliemichel
Copy link

The documentation admits that "we have a slightly messy layout", and my question might be naive, but why not writing a different object for each type of node (that may inherit from a virtual NetworkNode class)?

@danpovey
Copy link
Contributor

The reason is that in the code, NetworkNodes are mostly accessed as you
would a struct, and we deal with vectors of them. If there were
polymorphism involved, we could no longer deal with vectors of NetworkNodes
but we'd have to deal with vectors of pointers to them; and accessing their
data members would involve about 3 times as much code as it currently does,
as we'd have to figure out which type it was and do an appropriate type of
cast.

Dan

On Wed, Sep 16, 2015 at 5:54 PM, Elie Michel notifications@github.com
wrote:

The documentation admits that "we have a slightly messy layout", and my
question might be naive, but why not writing a different object for each
type of node (that may inherit from a virtual NetworkNode class)?


Reply to this email directly or view it on GitHub
#144.

@eliemichel
Copy link
Author

Got you, it indeed looks like a good reason. =)

hainan-xv pushed a commit to hainan-xv/kaldi that referenced this issue Jul 24, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants